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...
Answered

Update Posting Number on Sales Header via API

(0) ShareShare
ReportReport
Posted on by 1,270

Hi.

A client is implementing a CRM interface to BC and they need to create and post Sales Invoices in BC when a sales invoice is created in the CRM.

They have a specific requirement to get the Sales Invoice and the Posted Sales Invoice number to match the the CRM's invoice and they are using the CRM partner to develop the interface. 

So far, they managed to create the sales invoice in BC and post the document via API. However, they struggle to update the sales header field Posting No. so that the posted sales invoice number will flow from that field instead of following the default number series.

Manual numbers are allowed in BC for both the sales invoice and the posted sales invoice.

Any suggestion?

Thanks.

  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 Moderator on at

    Have you create a custom API that expose the posting no.?

    Because I can not find the posting no. exposed in any of the standard API's from Microsoft.

    Or are you using any other way to update the posting no. ?

  • Alfredo_Iorio Profile Picture
    1,270 on at

    I noticed the same.

    Posting number is not exposed in the standard API. Unfortunately, I am not helping with the interface development, I am only supporting on the functional side. The CRM partner is developing the interface.

    I assume they need to expose the field via a custom API first.

    I though they could also update the field using code in BC before posting the document.

    Which method would make more sense?

  • Suggested answer
    IB-29041624-0 Profile Picture
    1,191 Moderator on at

    If the posting number is available through and API from the CRM side then I think that the solution that requires the least coding is to call that API from within BC and then update the posting number after the Sales order is created.

    For that they can use the HTTP client in AL.

    Another solution could be to put the posting number in the externalDocumentNumber field in the API and then write some small code in AL that sets the posting no to the value of the externalDocumentNumber field.

  • RH-27040943-1 Profile Picture
    4 on at
    Hello, interested to know if you found a way for this to work @Alfredo?

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

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 676 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 483 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 310 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans