web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
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.
 
 
  • 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 676 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 483 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 310 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans