SBX - Search With Button

SBX - Forum Post Title

Inserting field to G/L Entry

Microsoft Dynamics NAV Forum

manideep22 asked a question on 11 Jun 2019 5:17 PM

Question Status

Verified

Hi,

I'm trying to post Sales order and I want one of the fields in sales order posted to the G/L entry. I don't see reference for the General Journal Line table (in PostGLAndCustomer function) in codeunit 80 to assign that field value from sales order table. How can we assign sales order field value to the general journal line field?

Reply
I Gusti Made Ari Permadi responded on 11 Jun 2019 8:57 PM
My Badges

You need to subscribe to table 81 to function "OnAfterCopyGenJnlLineFromSalesHeader(SalesHeader,Rec);"

Reply
manideep22 responded on 12 Jun 2019 9:44 AM

I don't have event type OnAfterCopyGenJnlLineFromSalesHeader inside table 81. Is there an alternative?

Reply
Teddy Herryanto responded on 12 Jun 2019 3:02 PM
My Badges

There is a CopyFromSalesHeader function in table 81

Reply
manideep22 responded on 12 Jun 2019 3:17 PM

Where can I use CopyFromSalesHeader to assign a field from Sales header to General Journal line?

Reply
Teddy Herryanto responded on 12 Jun 2019 3:28 PM
My Badges
Verified Answer

You can add your code inside the CopyFromSalesHeader function.

Reply
manideep22 responded on 12 Jun 2019 3:41 PM

I have added GenJnlLine.OriginalDocNo := SalesHeader.OriginalDocNo inside the function but I still see the Original Doc No as blank in G/L entry.

Reply
manideep22 responded on 12 Jun 2019 3:47 PM

It worked. Thank you.

Reply
Teddy Herryanto responded on 12 Jun 2019 3:28 PM
My Badges
Verified Answer

You can add your code inside the CopyFromSalesHeader function.

Reply

SBX - Two Col Forum

SBX - Migrated JS