Client wants to update a UDF in a Draft PO when importing the transaction.
Formatted search doesn't work, even when selecting refresh Regularly
I have created a Transaction notification to update a UDF which works:
DECLARE @TariffCode VARCHAR(15) DECLARE @Linecount INT SET @Linecount = (Select Count(T1.LineNum) FROM DRF1 T1 where T1.DocEntry = @list_of_cols_val_tab_del) IF @transaction_type in( 'A','U' )AND @object_type ='112' BEGIN WHILE @Linecount>=0 BEGIN SET @TariffCode = (SELECT ISNULL(T0.U_TariffCode,'') FROM OITM T0 Inner Join DRF1 T1 on T1.ItemCode = T0.Itemcode inner join ODRF T2 on T2.DocEntry=T1.DocEntry WHERE T1.DocEntry=@list_of_cols_val_tab_del and T1.LineNum=@Linecount-1) IF EXISTS (SELECT DocEntry FROM odrf WHERE DocEntry = @list_of_cols_val_tab_del and ObjType='22') UPDATE DRF1 SET U_Test = @TariffCode WHERE DocEntry = @list_of_cols_val_tab_del and ObjType='22' and LineNum=@Linecount-1 SET @Linecount = @Linecount-1 END END
Problem is that it somehow affects the Master Data such as BP and Item Master. When trying to update or add a BP for example, I get a conversion failed SQL error.