Skip to main content

Notifications

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

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

Posted on by 225
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.
Categories:
  • yoheswaran Profile Picture
    yoheswaran 225 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.
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,378 Super User 2024 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
  • gdrenteria Profile Picture
    gdrenteria 12,093 Most Valuable Professional on at
    How to insert Data into customized table after posting sales invoice.
    Maybe this can help 
     
  • Suggested answer
    Govinda Kumar Profile Picture
    Govinda Kumar 2,203 Super User 2024 Season 1 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.
  • yoheswaran Profile Picture
    yoheswaran 225 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
    Mohana Yadav Profile Picture
    Mohana Yadav 59,133 Super User 2024 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.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

New! Quick response templatesâš¡

Save time with the new custom templates!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,232 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,064 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans