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

Announcements

No record found.

News and Announcements icon
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.
  • Suggested answer
    Mohana Yadav Profile Picture
    61,260 Super User 2026 Season 2 on at
    Please share your code so we can check and suggest something.
  • yoheswaran Profile Picture
    231 on at
     [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,310 Moderator on at
    It's not very hard... kindly share your code, and let's see what can be done.
  • Gerardo Rentería García Profile Picture
    27,623 Super User 2026 Season 2 on at
    Maybe this can help 
     
  • Suggested answer
    YUN ZHU Profile Picture
    104,146 Super User 2026 Season 2 on at
    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
    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 633 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 419 Super User 2026 Season 2

#3
Teagen Boll Profile Picture

Teagen Boll 236 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans