When it comes to ordering a Bill of Materials there are a surprising number of options. Three to be specific. This might seem overkill to some people, but BOM ordering is a pretty important topic. So there are couple of different mechanisms used to fit the various requirements. Hopefully, you will find one that is right for you (because the engineering team doesn’t want to write a fourth).
Let’s start with the most inflexible. Strictly speaking, this is for cases where there is an assembly sheet with bubbles calling out each part detail. The parts list on the sheet is basically an ordered list of the called-out components. Vault preserves this data in the BOM as the Detail ID.
One interesting aspect of these Details IDs is that they are specific to an occurrence within a BOM. This means that a given part may have different Detail IDs in different BOMs even if the parent/child relationship is the same.
Another aspect of detail ID is that it’s strongly tied to the CAD file. Items created in the Item Master will not have these values. Detail IDs can only be created or edited through the BOM pipeline. So if a value needs to be updated, it requires checking out the file, modifying the CAD data, checking the file back in, and updating the item.
The fact that it’s difficult to edit is actually a good thing. The entire point of the Detail ID is that it’s tied to the CAD data. If you want something more flexible I suggest using...
Much like Detail ID this is a string value that identifies a BOM row. The main difference here is that position number can be easily edited in Vault. It’s not tied to CAD data, so it can be set on Items not created from a file. Lastly, it is not occurrence based, which means the position number is the same for each parent/child relationship regardless of which BOM it shows up in.
The default Position Number is a copy of the Detail ID, if it exists. Although you can edit the value in Vault, chose changes may get overwritten the next time the item gets updated from CAD. Ideally Position Number should be used when you want Detail ID behavior on an item with no Detail ID.
NOTE: Even though the word number is clearly in the title, the data type is a String. This happens a lot with Vault Items for some reason, like with Item Number.
Row Order behaves a lot like Position Number but with two main differences: Row Order is an integer, and Row Order does not get overwritten during an update from CAD file operation. This value is fully controlled in Vault, with minimal connection to CAD data. It’s great to use when you want your Row Order to have no other meanings. It doesn’t represent callouts in a drawing, or an ID in an external system. It’s just the order you want your BOM to be in.
Row Order is the only one of the three that is guraranteed to have a value. So it's a good default mechanism to use if you don't know which one to pick. But beware, the values are not guaranteed to be unique (the same is true for the other two systems).
Relevant ItemService APIs
If you want to read the Detail ID, you need to read the occurrence data from a BOM. When calling GetItemBOMByItemIdAndDate make sure to pass in ReturnOccurrences as one of the BOMViewEditOptions. If you do, you should get back an array of ItemBOMOcc objects. The Val property on this object is the Detail ID.
Both Position Number and Row Order can be read on the ItemAssoc objects in an ItemBOM. Row Order is the BOMOrder property, and Position Number is the PositionNum property. To update Postition Number or Row Order, use the UpdateItemBOMAssociations function.