web
You’re offline. This is a read only version of the page.
close
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...
Suggested Answer

Update status of sales invoice in Business Central using API

(0) ShareShare
ReportReport
Posted on by

Is it possible to update the status of a Sales Invoice in Business Central via the API or in Business Central?

Screenshot-_2800_241_2900_.png

I have the same question (0)
  • JAngle Profile Picture
    133 on at

    There is a codeunit published as a web service called WorkflowActionResponse. It has two actions that Power Automate uses to do the activity you want over Odata (RESTful API) - WorkflowActionResponse_Approve or WorkflowActionResponse_Reject. It takes a Workflow Step ID as a parameter. Given you're not trying to do that I expect you will need a custom codeunit to perform the task. This blog gives an example of doing such a thing: joshanglesea.wordpress.com/.../

    Business Central controls the "Status" field with the use of code so you'd need to do similar via an API call.

  • Suggested answer
    Mohsin Abbas Profile Picture
    525 on at

    In Sales Header table(36), there is a function SetStatus(). You can call this function in one of your codeunits(or create a new codeunit) and expose it as a webservice.
    Please let me know if this helps.
    Regards,
    Mohsin Abbas

  • Community Member Profile Picture
    on at

    Could you please elaboarte more on this. Where can I find the SetStatus() function? Is there a documentation I can look up on how to create a new codeunit and expose it as a webservice? Thanks.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,143

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,694 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,067 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans