cancel
Showing results for 
Search instead for 
Did you mean: 

Hi I need help on S.P Notification how to stop updating item description if item has P.O created

ramco1917
Participant
0 Kudos
Hi
I need help on Stored Procedure Notification how to stop updating item description if item has P.O created.
 
Regards

Accepted Solutions (1)

Accepted Solutions (1)

fbio_bilicki
Active Contributor

Hi,

I always number my locks in transactions, write down how to do this

IF (@object_type = '4' and @transaction_type = 'U')
BEGIN
	SELECT TOP 1
		@error = 4,
		@error_message = 'TF[4.1]: Item description cannot be changed, there are purchase orders generated = ' + @list_of_cols_val_tab_del 
	FROM OITM T0
	INNER JOIN AITM T1 ON T1.ItemCode = T0.ItemCode AND T1.LogInstanc = (SELECT MAX(LogInstanc) FROM AITM WHERE ItemCode = T0.ItemCode) 
	INNER JOIN POR1 T2 ON T2.ItemCode = T0.ItemCode
	WHERE T0.ItemCode = @list_of_cols_val_tab_del 
	AND T0.ItemName <> T1.ItemName
END

Rgs.

Fabio

Answers (0)