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
Madhura BMadhura B 

Assign Pricebook Id to Quote


I would like to know if there is a way to assign PriceBook Id to Quote using configuration. 

My org has just one pricebook and the same is assigned to all Quotes when a new Quote is getting created in a class. This leads to 'unbale to lock row exception' or lookup skew. 

Thanks in advance


NagaNaga (Salesforce Developers) 
Hi Madhura,

You can add products, quote line items, or order products only from a single price book. Click Choose Price Book in the Products related list on an opportunity or the Quote Line Items related list on a quote to select a price book. This button appears when you have access to more than one price book. If you have access to more than one price book and the button isn’t visible, ask your administrator to add it to your page layout.

Please click on the below link

Best Regards
Naga Kiran
Madhura BMadhura B

Thanks for your response Kiran. My issue is a little different. Sorry if I wasn't clear earlier. 

As of now for all the new quotes that are created, we are assigning PriceBookId in a batch class. Say there are 200 quotes getting created and all records will have the same pricebookId. This is leading to unable to lock row exception. On extensive research I learnt that it's a lookup skew on the parent record. So I was wondering if there is a way to assign pricebookid to newly created quotes using a rule or something instead of from a batch class.