Set Unit Price Order Entry ChangeUnitPrice method

Good morning! I am trying to set the unit price through C# in the Configurator document rules. I am not setting the price of the configured part, but rather the price of an additional line that the configurator creates as part of the Configuration process. I’m able to create the line but I want to set the unit price based on a calculation. I am having no luck getting it to stick. I did a trace and I am following the sequence that the UI goes. Is there a trick I am missing? Or one of those “you just have to know” kind of things?

I’m doing GetNewOrderDtl, ChangePartNumMaster, ChangeSellingQtyMaster, ChangeUnitPrice, MasterUpdate in that order. I set the price of the line between ChangePartNumMaster and ChangeSellingQtyMaster.

Ok. So the magic field to set is called DspUnitPrice on the Sales Order. That’s evidently what ChangeUnitPrice looks at. And this needs to be committed with a MasterUpdate, not a regular Update.

Also, in the quote, the magic field to set is called DocDspExpUnitPrice. Also, it’s a little different in the quote (isn’t it always?). If you do a trace on the quote, it actually commits the new row with a method called GetDtlUnitPriceInfo… but when you actually set the price, it sends a new method called GetDtlUnitPriceInfo_User and it’s considered an update. So you have to also include the RowMod = “U” to whatever code you’re sending and then commit with an Update.