The sample project provided by Microsoft - "EstimateFreight" - does NOT work for Invoices or Fulfillment Orders because the distribution table is not updated:
Dynamics.Forms.SopEntry.SopEntry.LocalOriginatingFreightAmount.Value =
Convert.ToDecimal(estimatedFreightString);
// Force the validation of the new freight amount
Dynamics.Forms.SopEntry.SopEntry.LocalOriginatingFreightAmount.RunValidate();
Dynamics.Forms.SopEntry.SopEntry.LocalOriginatingFreightAmount.ForceValidate(true);
In my solution, tried adding a SOPEntry.PullFocus(). But it doesn't help. Shouldn't it do all processing that would be done if I typed the freight in manually?
Note: the distribution problem occurs if there was an original value in Freight and its modified. Seems OK if freight was 0.0 prior to writing.