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

Trying to Create a Production Order via Custom API

(1) ShareShare
ReportReport
Posted on by 8
Good day,
 
I am trying to create a production order via a custom API since this is not part of the standard API.
Using the below payload:
 
{
    /SourceNo/: /1008/,
    /Status/: /Planned/,
    /LocationCode/: /TestLocation/
}
Results in the following error:
The Production Order does not exist. Identification fields and values: Status='Planned',No.=''
I have been able to create the production order with only SourceNo or LocationCode but not both.
If I create a production order with either SourceNo or LocationCode only and then try to /update/ the production order by specifying the No. I get the following error:
{
    /SourceNo/: /1008/,
    /Status/: /Planned/,
    /No./: /MO101186/
}
An unexpected instance annotation name 'No.' was found when reading from the JSON reader, In OData, Instance annotation name must start with @
Any suggestions as to what I am doing wrong?
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    99,750 Super User 2026 Season 1 on at
    Hi, Regarding the first question, the primary key of table 5405 "Production Order" is key(Key1; Status, "No."), which you must include in the API, unless there is a program to automatically get the number in the standard code.
     
    As for the second one, the naming method of the fields in the page cannot contain., for example,  "number": "101005".
     
     
    Hope this helps.
    Thanks
    ZHU
     
     
     
  • Community member Profile Picture
    8 on at
    When trying to specify the No I also get an error: 
    {
        "SourceNo": "1008",
        "Quantity": 17,
        "LocationCode": "TestLocation",
        "No": "MO101193",
        "Status": "Planned"
    }
     
    You may not enter numbers manually. If you want to enter numbers manually, please activate Manual Nos. in No. Series MO
  • Suggested answer
    YUN ZHU Profile Picture
    99,750 Super User 2026 Season 1 on at
    Hi, this is a standard control. You can enable the Manual Nos. on the No. Series page and the error will disappear.
    (It seems like I can't insert pictures into the forum today, and they all show up as damaged. . .)
     
     
     
     
    Thanks.
    ZHU
  • Community member Profile Picture
    8 on at
    When creating the production order header I need to set the SourceNo and LocationCode. The only way I managed to create the Production Order Header was with the following steps:
    1. Enable Manual No.
    2. Specify only SourceNo in the payload as follows:
    {
        "SourceNo": "1008",
        "Quantity": 17,
        "Status": "Planned"
    }
     
    Response:
    {
        "Status": "Planned",
        "No": "MO101201",
        "SystemId": "47643264-1dfe-ee11-9f88-000d3a0c9711",
        "CreationDate": "2024-04-19",
        "DueDate": "2024-04-19",
        "SourceNo": "1008",
        "Quantity": 17,
        "UnitCost": 0,
        "SourceType": "Item",
        "LocationCode": "",
        "BinCode": ""
    }
     
    Note the creation date
     
    3. Get the Prod. Order No and make the same call with the LocationCode field in the request as well
    {
        "SourceNo": "1008",
        "Quantity": 17,
        "LocationCode": "TestLocation",
        "No": "MO101201",
        "Status": "Planned"
    }
     
    Response:
    {
        "Status": "Planned",
        "No": "MO101201",
        "SystemId": "47643264-1dfe-ee11-9f88-000d3a0c9723",
        "CreationDate": "0001-01-01",
        "DueDate": "2024-04-19",
        "SourceNo": "1008",
        "Quantity": 17,
        "UnitCost": 0,
        "SourceType": "Item",
        "LocationCode": "TestLocation",
        "BinCode": "M7-0"
    }
     
    LocationCode and SourceNo is now set correctly. However the CreationDate has been changed to 0001-01-01 as seen above.
    If I try to add the to the request, the error stipulates that it is a read only field
     
     Questions:
    - Why is the CreationDate wrongly updated?
    - Why do I have to make the same call twice to update the header after creating in order to set to LocationCode field?

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 March 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,021 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,083 Super User 2026 Season 1

#3
Teagen Boll Profile Picture

Teagen Boll 731 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans