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

Trouble adding bom line of type "Production BOM": "Type must be equal to 'Item' in Production BOM Line"

(0) ShareShare
ReportReport
Posted on by 70

I have two BOMs, each with the same unit of measure. When I add a line to BOM1 of type Production BOM that reference BOM2, I get no errors. Where I'm seeing the issue is when I do this through the API, passing in Type as "Production BOM", returns the following error:

"Type must be equal to 'Item'  in Production BOM Line"

We are only using one unit of measure in our environment, I've seen that typically be an issue in the past, but I can't see that causing any problems here.

I have the same question (0)
  • Connor Hyde Profile Picture
    70 on at

    It also seems strange that I can make a PATCH request immediately after creating a line of type Item, changing only the type to Production BOM with no issue.

  • Suggested answer
    Andy Sather Profile Picture
    on at

    Hello,

    If you don't get further responses to this issue, you may want to raise a support request to Microsoft support via your CSP / Partner.

  • Suggested answer
    MahGah Profile Picture
    15,529 on at

    Hi

    A few questions

    1) Do you have any filter on your API? Such as filter for Type = Item? If yes that could cause an issue

    2) I think with API and Production Order you need to pass UOM for Production BOM as well. Can you try that as well?

  • Connor Hyde Profile Picture
    70 on at

    Hello,

    Thanks for the response, I'm not passing in any filters aside from the company id, and I have been passing in a UOM as well. I'll post some specific information on how I'm making the API call below. This is all done in a POST request, and I can actually use the same format for other bom numbers and get a successful result, which leads me to believe there is some business rule I'm not aware of that exists inside of BC causing this error:

    Request Body:

    {

    "Production_BOM_No":"756928",

    "Description":"BRACKET",

    "Unit_of_Measure_Code":"EACH",

    "Type":"Production BOM",

    "No":"756926",

    "Line_No":0,

    "Version_Code":"",

    "Quantity_per":1

    }

    Request URL:

    wiise.api.bc.dynamics.com/.../ProductionBOMLines?company={id}

  • Suggested answer
    MahGah Profile Picture
    15,529 on at

    That is strange, I mean looks like your API is correct. I usually see Line_No first (before anything else) but I do not think that cause this issue.

    I am not a developer. But maybe yzhums  is kind enough to provide some tips here.

  • Connor Hyde Profile Picture
    70 on at

    I think I might have found the issue, we have a BOM with number 756926, but also an item with that same number. Could this be confusing the API? I was able to get a POST call working when I deleted the item record but kept the BOM.

  • Suggested answer
    MahGah Profile Picture
    15,529 on at

    That could be. I mean if it works for Prod BOM that has no similar item then that could be the issue. But if that is the issue it looks like the [tag:bug]  to me since it is a high chance any company has both of them at the same time and that should not cause an issue for API.

  • Connor Hyde Profile Picture
    70 on at

    Okay so this time I've really found the issue. BOM lines can't have a unit of measure associated with them if they are of type 'Production BOM'.

    Edit:

    Or maybe not, it seems they can have a default uom, will update when I figure out some more

  • MahGah Profile Picture
    15,529 on at

    awesome. Thanks for sharing. This is really helpful

  • Connor Hyde Profile Picture
    70 on at

    I do think this is actually a [tag:bug], this will probably be my final update as I've been able to narrow down specifically what makes it work and break.

    1. Add BOM line of type 'Production BOM' in the BC interface, it will default the uom to whatever the BOM uom is

    2. Add BOM line of type 'Production BOM' through the API with said default value, it throws the type error - you cannot pass in any value for uom

    Furthermore, to reproduce the error in the UI, you can change the uom of a 'Production BOM' type line to anything other than the default value. This goes for both lines added manually and through the API.

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 2,135

#2
YUN ZHU Profile Picture

YUN ZHU 733 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 612

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans