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...
Suggested Answer

Insert item with API

(2) ShareShare
ReportReport
Posted on by 24
Hi all,
I have made an API that, with a json in input, can create a record in business central and insert the record in the database. For doing this, I have made validation for each field I read from the json. And this is the problem: when I try to insert a new item, the insertion fail becuse the insert is done by Microsoft in the validation of the "Base Unit of Measure" field.
Why Microsoft is doing this? I know the workaround to avoid this, but I want to know why microsoft is doing an insert in the validation of a field?
I have the same question (0)
  • Suggested answer
    Valentin Castravet Profile Picture
    32,689 Super User 2026 Season 1 on at
    When you create a new item manually the system automatically adds the item and its base unit of measure in the Item Unit of Measure (5404) table as well. This is done when the item's base unit of measure is selected. 
     
     
     
  • Suggested answer
    YUN ZHU Profile Picture
    100,998 Super User 2026 Season 1 on at
    From the code, it seems that Microsoft only want to run the code in the OnInsert trigger of the table.
    You can confirm the content of this trigger.
     
    Hope this helps.
    Thanks.
    ZHU

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,002 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,255 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,217

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans