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
Will@X-IO.comWill@X-IO.com 

Locked Quote Allow Create PDF?

We have 2 Quote Record Types (Draft and Approved).  In the Draft layout, the Create PDF and Email buttons are removed.  We do not want users to create a PDF (whether SF lets you e-mail it or not) until the quote is approved.  We have an approval process that changes the record type to Approved (which exposes the Create PDF and Email) buttons.  However, we are seeing users say that they are receiving 'Insufficient Priveleges' message for this.  I suspect that this is because the approval process locks the quote (once approved, the user shouldn't be able to change anything).

 

So how can we enable the ability to create a PDF from a locked quote?

Best Answer chosen by Admin (Salesforce Developers) 
Will@X-IO.comWill@X-IO.com

I believe I solved the problem.  Instead of locking the quote record at the end of the approval process, I set the record to be unlocked.  I already had a different record type for quotes (Draft and Approved), so I could create Validation Rules similar to those referenced in the link below to prevent insert, edit, delete of Quote Line Items if Quote Record Type = Approved.  I also made a Validation Rule to prevent edit of the other fields on the Quote record itself that should not be editable after approval.  By doing this it seems to successfully prevent changing the things that were approved while still allowing Create PDF and Email functions.

 

https://help.salesforce.com/HTViewSolution?id=000004872&language=en_US

All Answers

Saurabh DuaSaurabh Dua

This is a permission issue and is not because the quote is locked. U need to check wether the user has access to all the objects used in the quote pdf. 

Will@X-IO.comWill@X-IO.com

User will be the owner of the Opportunity, Account, and Quote therefore they have rights to all of those.  They have Read All on Assets (in case those are referenced) and Read All on Products.  They have Read All, Create and Edit on Quote and QuoteLineItem.  I cannot see where the permissions are lacking.

Will@X-IO.comWill@X-IO.com

I also just checked and as admin unlocked the Quote record.  Then logged back in as the user and was able to create the PDF.  So it is the record locking that is the problem.  Again I pose the question:

 

How are we supposed to prevent users from editing quotes once they are approved, but still give them the ability to Create PDF and Email Quotes?

Will@X-IO.comWill@X-IO.com

I believe I solved the problem.  Instead of locking the quote record at the end of the approval process, I set the record to be unlocked.  I already had a different record type for quotes (Draft and Approved), so I could create Validation Rules similar to those referenced in the link below to prevent insert, edit, delete of Quote Line Items if Quote Record Type = Approved.  I also made a Validation Rule to prevent edit of the other fields on the Quote record itself that should not be editable after approval.  By doing this it seems to successfully prevent changing the things that were approved while still allowing Create PDF and Email functions.

 

https://help.salesforce.com/HTViewSolution?id=000004872&language=en_US

This was selected as the best answer
Charles LindorferCharles Lindorfer
Thanks for the help on this Will@X-IO.com! The two validation rules I set up:

Quote line item: ISPICKVAL(Quote.Status, "Approved")
Quote object: AND (ISPICKVAL(Status , "Approved"), LineItemCount < PRIORVALUE(LineItemCount))
Charles LindorferCharles Lindorfer
I also adjusted the field level security to make the Quote Status field Read Only for the reps