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

How to disable standard CreatePDF button on quote, based on status picklist value



can you tell me, how to disable the standard CreatePDF button on quote view page based on status picklist value.


CreatePDF button should be enable only when that status is  "Approved " or "Accepted"


Thanks in Advance



This is little bit tricky.


Create Record Type 

1) ApprovedAccepted RecordType


Create Page Layouts

1) Standard Page Layout --> Which has no CreatePDF Button

2) ApprovedAccepted Page Layout --> Which contains CreatePDF Button.


Now whenever status will be changed to  "Approved " or "Accepted", and record is being saved to database, update quote recordtypeId to the  ApprovedAccepted RecordType Id. Thus after successful completion of Save operation. standard page layout will be replaced with the ApprovedAccepted Page Layout. you can do this with the help of trigger/controller.


In Short, Update RecordType Id, will change to  Page layout. But make sure you have assign page layout to record type. 


Hope this will solve your issue.