Create new activate price using x++

Hello All,

Please help me with the code how to create a new line in InventItemPrice and activate the same using code.

I am trying to achieve this as I am trying to automate the cost roll up for all the available parent items if a child item price is updated.


Do you already have pending prices(InventItemPriceSim) and want to activate all the pending lines?
Or just created active prices without using pending prices?
Have a look at \Data Dictionary\Tables\InventItemPrice\Methods\updateLastPrice
\Data Dictionary\Tables\InventItemPriceSim\Methods\moveSimulatedToCurrent

No I want to create a new line and activate only the lines that I have created

For code reference see, \Data Dictionary\Tables\InventItemPriceSim\Methods\moveSimulatedToCurrent

Hello Kranthi,

I also want to update the price as like we get it when we click calculation in the BOM designer or invenetItemprice form.

Please check the below image for your reference,

Please help me how to get the calculated price value.


Do you mean running BOM calculation by using X++? If so, you may try using BOMCalJob class.