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

Bound Action ..receiveAndInvoice returns error however is sucessful in recieve only scenario

(0) ShareShare
ReportReport
Posted on by 3
Consider a one line Purchase Order (id= xxxx )  with a quantity of 1 Item to purchase. 
On delivery of the Item I want to use the api to update the line with: 
invoiceQuantity =0 ( since Invoice not yet received)
recieveQuantity  =1 ( since the 1 ordered item was received). 
 
Next step is to post the reciept using the API bound action : 
https://{INSTANCE}/api/v2.0/companies(24e9e5bb-e146-ee11-be72-6045bdacc06d)/purchaseOrders({xxxx})/Microsoft.NAV.receiveAndInvoice
 
tested with powershell invoke- webrequest:
$caughtError=//
try {
Invoke-WebRequest -uri $uri -Method Post  -Credential $credential -Header $Headers
}
catch {
   $caughtError  = $_
The result is an error : 

Response status code does not indicate success:    
                        400 (You need to enter the document number of the document from the vendor in the Vendor Invoice No.    
                        field, so that this document stays linked to the original.).
 
Hoewever - the receipt has been posted to the purchase order and the order line is updated with the Quantity Recived + 1
(and Quantity to Invoice = Quantity Received - Quantity Invoiced)
 
I do not expect this error since it is not generated either when posting from the webclient. 
 
Any thoughts? 
I have the same question (0)
  • Community member Profile Picture
    2 on at
    We have the same issue, but experience a different error message:
     
    "There is no Purch. Inv. Header within the filter.\r\n\r\nFilters: Order No.: INX1230012, Order No. Series: ''
     
    It seems like BC expects that there will always be an invoice, when building the response.
     
    I guess we will have to mitigate this error in the API, by enterpreting this specific error message as success.
     
     

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 2,092

#2
YUN ZHU Profile Picture

YUN ZHU 663 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 515

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans