(CRM2011, rollup 11, on premise)
I have a series of plugins that automatically add invoice details to an invoice when certain fields on the invoice are completed. In some cases, there is additional code that sets an overridden field on the detail. For some reason, at the end
of the process, when I need to override the price, the invoice detail always shows $0. Here's an outline of what happens
Invoice: Post-Op Synchronous
check for scenario; if found, create some line items (generically, no special handling)
Invoice Detail: Pre-Op Synchronous
check for scenario; if found, set priceIsOverriden flag and set pricePerUnit and baseAmount
When I stop the plugins in the Invoice Detail plugin, the trace shows the values are correctly set prior to platform operations.
When I move the stop back to the Invoice plugin after the service call to add the line items, and query/trace the associated invoice details that were just created, the priceIsOverriden flag is true but the pricePerUnit and baseAmount are both $0.
Any ideas why the values I am supplying are being overwritten with 0?