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
Shanky77Shanky77 

How to hide or disable the Edit Button depending upon some condition(Urgent and Important)

How to hide or disable the Edit Button depending upon some condition say for example if particular check box is checked then edit button should no longer be visible.

Best Answer chosen by Admin (Salesforce Developers) 
SargeSarge

Hi,

 

   Create two page layouts and two record types. One page layout will have the edit button another will not have the edit  button. Assign these page layouts to the two newly created recortd types.

 

     Configure a workflow that will update the record type (field update) to the one which has the page layout associated with having no edit button.

Workflow Criteria maybe as below

 

AND(
      ISCHANGED(Checkbox_Field__c),
      Checkbox_Field__c = true
)

 

 

  When the checkbox is checked, this workflow will fire which will change the record type to the one having page layout

without edit button.

Configure another workflow to reverse this functionality. i.e. on checkbox un-checked, change the record type to the one which has got the page layout having edit button.

 

Hope this helps.

All Answers

SargeSarge

Hi,

 

   Create two page layouts and two record types. One page layout will have the edit button another will not have the edit  button. Assign these page layouts to the two newly created recortd types.

 

     Configure a workflow that will update the record type (field update) to the one which has the page layout associated with having no edit button.

Workflow Criteria maybe as below

 

AND(
      ISCHANGED(Checkbox_Field__c),
      Checkbox_Field__c = true
)

 

 

  When the checkbox is checked, this workflow will fire which will change the record type to the one having page layout

without edit button.

Configure another workflow to reverse this functionality. i.e. on checkbox un-checked, change the record type to the one which has got the page layout having edit button.

 

Hope this helps.

This was selected as the best answer
PratikshaRJPratikshaRJ
THANK-YOU so much, it was really a small task but it was tricky, and with your help it was really easy, thanku once again!!! :)