web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

How to insert Data into customized table after posting sales invoice.

(0) ShareShare
ReportReport
Posted on by 231
Hi everyone,
 
  I have created two customized tables same as header and line, once I post the sales invoice the header and line data of the sales invoice need to insert in my customized table, I did for header the value inserted in the customized table header, but for line, it's not working and then I tried to take the value from sales invoice header and line, same the line value is not inserting into my customized line table.
I have the same question (0)
  • Suggested answer
    Mohana Yadav Profile Picture
    60,979 Super User 2025 Season 2 on at
    How to insert Data into customized table after posting sales invoice.
    Please share your code so we can check and suggest something.
  • yoheswaran Profile Picture
    231 on at
    How to insert Data into customized table after posting sales invoice.
     [EventSubscriber(ObjectType::Codeunit, 80, 'OnAfterInsertInvoiceHeader', '', true, true)]
        local procedure OnAfterInsertInvoiceHeader(var SalesHeader: Record "Sales Header"; var SalesInvHeader: Record "Sales Invoice Header")
     
    Is the event is correct for insert invoice line?
  • Suggested answer
    Govinda Kumar Profile Picture
    2,304 Moderator on at
    How to insert Data into customized table after posting sales invoice.
    It's not very hard... kindly share your code, and let's see what can be done.
  • Gerardo Rentería García Profile Picture
    23,861 Most Valuable Professional on at
    How to insert Data into customized table after posting sales invoice.
    Maybe this can help 
     
  • Suggested answer
    YUN ZHU Profile Picture
    94,022 Super User 2025 Season 2 on at
    How to insert Data into customized table after posting sales invoice.
    Hi, because the sales invoice lines in the event you use have not been inserted yet, it is empty. You could try the events suggested by gdenteria.
     
    Hope this helps.
    Thanks.
    ZHU
  • yoheswaran Profile Picture
    231 on at
    How to insert Data into customized table after posting sales invoice.
    Thank you all i got the answer i wrote the code in the event which was suggest by gdenteria.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,351

#2
Sumit Singh Profile Picture

Sumit Singh 2,072

#3
YUN ZHU Profile Picture

YUN ZHU 1,807 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans