Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9069

I am writing code in the TransactionNotification Stored Procedure. I want to prevent a user from changing the item group if there is stock onhand. How do I compare the old values to the new values to see if item group was the thing that got changed?

$
0
0

IF @transaction_type = 'U' AND @object_type = '4'  -- update items object

BEGIN

   IF EXISTS(

       SELECT   T0.[ItemCode]

       FROM OITM T0

       WHERE T0.[ItemCode] = @list_of_cols_val_tab_del 

        AND T0.[OnHand] > 0 )

 

  BEGIN

    SELECT @error = 12, @error_message = 'Cannot change Item Group Code '

  END

END

 

The code above will prevent a change to ANY field on item master if there is stock onhand.  How do I find out if Item Group was changed?

Any help you can provide is greatly appreciated.

Kathy


Viewing all articles
Browse latest Browse all 9069

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>