I want to make the partner name field on a custom object read only for one particular type of records, and this partner name has to be updated by a process builder from another custom object.
I have tried validation rules to restrict editing partner name, but its giving me error when the process is fired. Making the field read only, makes the field uneditable for other type of records .
Currently we don't have plans to use any record types or different page layouts. Is there any way to achieve this still. Appreciate your help.
2 answers
How about this -
- Create a Hidden Checkbox like this =
- Label: Enable Name Alteration
- Type: Checkbox
- Make it Visible to all Profiles
- But DON'T add to
Page Layout
- Now add a VR like this =
AND( NOT(Enable_Name_Alteration__c), /*Add Condition to Determine the Specific Category of Record*/ ISCHANGED(Name))
- In the Process Builder Update Records Action wherein you are changing the Name, add a another line to set this Checkbox to TRUE.
[Object].Enable Name Alteration equals Boolean True
This is to bypass the VR and allow the update to happen. - In the same Immediate Action Node, add another Update Records action that will set this back to FALSE. This is to reset the checkbox.
[Object].Enable Name Alteration equals Boolean False
Now another way is to explore if we can do this via
Workflow Rules as they are not affected by Validation Rules :-)- Create a Hidden Checkbox like this =