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
Matthew Hayes 46Matthew Hayes 46 

Error message Price Book

I am getting the following error message"field integrity exception: Pricebook2Id (cannot change pricebook on opportunity with line items)".  I am not sure what this means.  We had an opportunity come in and after we went through the process realized that the price book was incorrect.  We need to update the price book so we can update the price.  FYI, I am an admin and not a developer.
Best Answer chosen by Matthew Hayes 46
VinayVinay (Salesforce Developers) 
Hi Mathew,

Yes,  I have shared sample links to review on related error.

Please mark as Best Answer if above information was helpful so that it can help others in the future.

Thanks,
Vinay Kumar

All Answers

VinayVinay (Salesforce Developers) 
Hi Mathew,

Review below links for similar issue and looks like your Opportunity.Pricebook2Id should be equal to your OLI.pricebookEntry.Pricebook2Id.

https://salesforce.stackexchange.com/questions/110751/error-pricebookentryid-pricebook-entry-is-in-a-different-pricebook-than-the-on
https://ipfs-sec.stackexchange.cloudflare-ipfs.com/salesforce/A/question/110751.html

Update your logic accordingly.

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Vinay Kumar
Matthew Hayes 46Matthew Hayes 46
So to clarify. This error is most likely in code and I will need a developer to fix it?
VinayVinay (Salesforce Developers) 
Hi Mathew,

Yes,  I have shared sample links to review on related error.

Please mark as Best Answer if above information was helpful so that it can help others in the future.

Thanks,
Vinay Kumar
This was selected as the best answer