One very big feature in Vault 2015 is the ability to turn a BOM row “on” or “off”. I’m going to quickly go over the workflow for disabling a BOM row through the API and how to view that disabled row.
The on/off status of a BOM row is handled by the “isIncluded” property on a BOM association. So disabling a BOM row is just a matter of setting isIncluded to false.
Basic steps (all functions are in the ItemService):
- Call EditItems on the parent Item in the association.
- Call GetItemBOMByItemIdAndDate to read the BOM. Make sure to use the item ID from the editable item returned in part 1.
- In the resulting ItemBOM object, locate the ItemAssoc object representing the row you want to disable.
- Call UpdateItemBOMAssociations to update the isIncluded value. Although the function takes arrays of data, you only need to pass in the associations you are updating.
- Call UpdateAndCommitItems, passing in the parent item only. This will finalize the change.
Viewing the BOM
By default, the GetItemBOMByItemIdAndDate will omit all of the OFF rows. If you want to see the row you disabled, you need to include “ReturnExcluded” in the options parameter. This parameter lets you OR together multiple options, like a bitfield. So passing in both “Defaults” and “ReturnExcluded” with show all the ON and OFF item rows.