+ 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