I would like to update a User Defined Field on the Journal Entry lines (JDT1) with the vendor ref no (numatcard) when I add an AP invoice using the PostTransactionNotice. I am having trouble with the code as I am adding the record from the AP invoice. I have tried it with object type =30 (je) and 18 (ap inv) I have tried with the code that is commented out as well.
Any help would be appreciated. Thank you.
---set udf on jdt1 to numatcard from ap invoice
IF (@transaction_type = 'A' and @object_type = '30') begin
--if exists (Select OPCh.docentry from opch inner join ojdt on opch.transid = ojdt.transid inner join jdt1 on ojdt.transid =
---jdt1.transid where opch.docentry = @list_of_cols_val_tab_del)
update JDT1 set jdt1.U_doc_inv_no = (select OPCH.NumAtCard from OPCH where opch.[TransId] = JDT1.[TransId])
where JDT1.transid = @list_of_cols_val_tab_del