cancel
Showing results for 
Search instead for 
Did you mean: 

Update Journal entry UDF when add Document

Laura_Nest
Participant
0 Kudos

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)

Begin

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Andre_S
Contributor
0 Kudos

Hi Laura,

why are you not using Reference Field Links function in B1 instead? You should be able to fullfil your requirement with this function instead of writing a Post TN.