In Business Central under the webservices I have added the CodeUnit 90 "Purch.-Post" and named it PurchaseOrderPost
From PostMan I'm trying to call the CodeUnit using the ODataV4 URL:
{{BusinessCentralURL}}/{{TenantId}}/{{Environment}}/ODataV4/PurchaseOrderPost
In the headers I pass the Company Id:
I havn't found a way to pass the PurchaseOrder number or ID.
I'm using the OAuth 2.0 authorization
The URL, TenantId and Environment are parameters, that are reused in multiple calls, for example:
{{BusinessCentralURL}}/{{TenantId}}/{{Environment}}/ODataV4/Company('CRONUS%20Danmark%20A%2FS')/PurchaseOrderPage?No='106001' - which works fine.
The response is "Resource not found for the segment 'PurchaseOrderPost'"
and looks like this:
Has anybody successfully called the code unit 90 Purch.-Post? and would you please share how to?
you need to create a new codeunit were in you need to set all the values using events i.e. receive, what will be the purchase order number. After that call purchase post codeunit.
Hi, as Mohana mentioned, you need to create a custom API at this time. Generally, there are two solutions.
Creating and Interacting with an OData V4 Bound Action: https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-creating-and-interacting-with-odatav4-bound-action
Add custom execute actions: https://yzhums.com/20111/
Hope this helps.
Thanks.
ZHU
then you may have to create a custom API page (copy of 30066 API) and set only receive to true in PostInvoice function
Thanks Mohana, I did consider this, but I only want to receive the lines, not invoice
I'm looking for the equivalent to the first option in the purchase order booking popup (receive only):
I was able to successfully use the below
api.businesscentral.dynamics.com/.../NAV.ReceiveAndInvoice
I published 30066 page as purchaseOrders
I tried with and without the ODataV4 in the URL, same result.
Any suggestions on how to pass the Company and PuchaseOrder number/ID ?
hi
try this
Method: POST
URI: api.businesscentral.dynamics.com/.../{MyNameWS}
Authorization: Bearer + Access Token
DAniele
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,219 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156