Announcements
I use the MS web API and with it I POST purchase invoices. For development I use Visual Studio and .NET Core.
I first POST the invoice header using the purchaseInvoice resource type.
Then I POST the invoice line(s) using the purchaseInvoiceLine resource type and the purchaseInvoice Id
I want the invoice to be posted immediately (not as a draft), therefor I issue a bound action.
After posting the bound action I get an exception, Application_DialogException,Total amount (0.00) is not equal to total of lines (242.00).
The total amount of the invoice header is not the amount I send (242.00), but 0.00
Why is the correct total amount not showing, but instead 0.00?
And how can i solve this?
Hi, You should first rule out the problem mentioned by Inge, it looks like the Line amount is not validated on the header.
If it still doesn't work, you can try the deep insert method below.
https://www.kauffmann.nl/2020/07/01/deep-insert-with-business-central-apis-part-2/
Hope this helps.
Thanks.
ZHU
You should try to post the same transaction using GUI to see if you run into the same problem there. Then you at least can determine if it is a API problem or not.
Hello,
We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist. If you need assistance with debugging or coding I would recommend discussing this on one of our communities.
I will open this up to the community in case they have something to add.
Thanks.
André Arnaud de Cal...
294,095
Super User 2025 Season 1
Martin Dráb
232,866
Most Valuable Professional
nmaenpaa
101,158
Moderator