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

Insertion of order lines via API fails

(0) ShareShare
ReportReport
Posted on by 39
Hello everyone, and thanks for your help.
 
: : : :   WORKING SITUATION   : : : :
 
    we have an automated system that inserts orders in Business Central using the BC API.
The system creates an order using a custom API and then adds lines to it using another API.
 
The system works adding the following fields to the order:
'sellToCustomerNo','documentDate','operationOccurredDate','postingDate','orderDate','yourReference','operationType','paymentTermsCode','documentType','EOSUserDefinedField20',
And then the following fields to the order line:
'documentNo','type','no','description','locationCode','quantity','unitPrice','lineDiscount','lineAmount','qtyToShip','qtyToInvoice','plannedDeliveryDate','plannedShipmentDate','shipmentDate','shortcutDimension1Code','shortcutDimension2Code','ShortcutDimCode3','documentType',
And, as said, all this is working correctly.
 
 
 
: : : :   MODIFICATION REQUEST   : : : :
 
The request is to add the
vatProdPostingGroup
vatBusPostingGroup
fields to the order line and the order, so that those fields are set correctly in the resulting orders.
 
 
 
: : : :   THE PROBLEM   : : : :
 
For the test order we have the following custom VAT code values:
 
vatProdPostingGroup: '22.S' (our normal 22%VAT)
vatBusPostingGroup: 'NAZ' (national customers)
 
When adding those fields we get different results (error or no field added) depending on the situation.

1) Initially, adding the vatProdPostingGroup field to the line and the vatBusPostingGroup to the order we got an error:
 
The VAT Posting Setup does not exist. Identification fields and values:
VAT Bus. Posting Group='',VAT Prod. Posting Group='022.S'
 
This shows that the Vat Bus Posting Group is totally ignored (instead of 'NAZ' it is set to an empty string) and BC complains the combination ( empty, '22.S' ) is not registered in VAT Posting Setup. The order is left empty, with no lines, but the VAT Bus Posting Group is correctly set to NAZ (!!)
 
 
2) Adding the combination of ( '' empty , '22.S' ) in VPS:

 
avoids the error, and the line is correctly added to the order, but (and this was very surprising) the VAT Prod Posting Group is left empty!
 
 
So, first BC complained about not beeing ableto add a line with said VAT Posting- After adding the right combo, it added the line without the VAT posting.
 
At this point we have no clue. Any help is apprecieted.
 
Thanks for any suggestion you can give us... for any doubt or clarification please ask.
 
 
I have the same question (0)
  • Alberto Zamburlini Profile Picture
    39 on at
    Any idea why this happens?
  • Alberto Zamburlini Profile Picture
    39 on at
    Nobody?

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,377

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,696 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,512 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans