function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DiMDiM 

Updating UnitPrice In OpportunityLineItem

I am trying to update the UnitPrice in OpportunityLineItem through a C# application that I am working on. The amount that I am using is of type double and have verified that I am passing it the correct Id.  I have saved the results to the SaveResult[] object and have verified that there are no errors on the update, however, when I go back into Salesforce, it has not been updated.  Any ideas?

Here is a code snippet:

sforce.OpportunityLineItem OpLiIt = new sforce.OpportunityLineItem();

OpLiIt.Id = MP.OLIID;

OpLiIt.UnitPrice = MP.profit.

MP.binding.update(new sforce.sObject[]{OpLiIt});

 

Thanks

 

DeLDeL

Hi,

I had a similar problem.  You also need to set the UnitPriceSpecified field = true in order to update the UnitPrice field.

Hope that helps,

DeL

DiMDiM

Thank you, thank you, thank you.

That fixes the problem