I am executing following code to update UnitPrice in Opportunity line item:

OpportunityLineItem oli = [SELECT UnitPrice FROM OpportunityLineItem WHERE Id = '00k8E000007TzxjQAC'];
oli.UnitPrice = 10;
update oli;

After updating the UnitPrice, the field keeps its original value.

What am I doing wrong?

  • 2
    I was able to update the UnitPrice with same quote you posted. Are you using a non-standard pricebook? and is there any inetgration that syncs quotes? – Pranay Jaiswal Nov 9 '18 at 11:10
  • Sorry for my late response. I am using non-standard pricebook. Why? – Cuban coffee Dec 20 '18 at 14:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.