Skip to main content

Notifications

Announcements

No record found.

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

How I can approve the invoices using web-service?

(1) ShareShare
ReportReport
Posted on by 100

I want to approve my posted invoices from OPEN to released, So for this approach I want to use the web-service but I search almost more than 50 web-services so please share the approach for that approve the invoices using web-service.

  • steveendow Profile Picture
    steveendow 2,281 on at
    RE: How I can approve the invoices using web-service?

    I initially looked into how Power Automate is able to approve documents through a BC Workflow Approval process using a flow.  I saw that it was calling WorkflowActionResponse_Approve. 

    1563.BC-Approval-Flow.jpg

    That call is not available through the BC v1.0 API, but someone helpfully explained to me that it is instead available through a Code Unit web service.

    8203.BC-Web-Service-List.jpg

    The remaining challenge would be figuring out how to call that presumably undocumented web services method. And there's the question of whether it's advisable to code against that Code Unit web service.

    But then I wondered about a different approach.  Rather than attempting to use a workflow method to update the document, I wondered if it is possible to directly update the document status.

    I don't know if this approach is advisable in BC, but I'm looking into the purchaseInvoices API to see if the "status" field can be updated with a PATCH.

    However, one oddity I found is that when I view a test Purchase Invoice in BC, the Status is Open. But when I retrieve the purchase invoice data from the BC v1.0 API, the status field value is "Draft".  So I'm concerned that there is something I'm not understanding about this approach.

    BC-Purchase-Invoice-Status.jpg

    BC-Purchase-Invoice-Open.jpg

  • Suggested answer
    JAngle Profile Picture
    JAngle 33,159 on at
    RE: How I can approve the invoices using web-service?

    You could use power automate or logic apps. It has the connector for BC setup with access to the web services you need. Otherwise it works as a reference for the correct web service names you need

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!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans