Skip to main content

Notifications

Announcements

No record found.

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,260

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.

  • Community member Profile Picture
    4 on at
    Update Posting Number on Sales Header via API
    Hello, interested to know if you found a way for this to work @Alfredo?
  • Suggested answer
    Inge M. Bruvik Profile Picture
    32,718 Moderator on at
    RE: Update Posting Number on Sales Header via API

    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.

  • Alfredo_Iorio Profile Picture
    1,260 on at
    RE: Update Posting Number on Sales Header via API

    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
    Inge M. Bruvik Profile Picture
    32,718 Moderator on at
    RE: Update Posting Number on Sales Header via API

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

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

Dynamics 365 Community Update – Sep 16th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

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

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans