Validation Rule on Required Fields - Answers - Salesforce Trailblazer Community
Ask Search:
Karen SilvaKaren Silva 

Validation Rule on Required Fields

Is it possible to create a validation rule on required fields so as to not allow users from editing + saving these? Can't seem to get mine to work. For example, I have the following for close date field which is required but it doesn't work:


AND(
RecordTypeId = "0120t000000OuW8AAK", 
ISCHANGED( CloseDate  )
$User.Alias = 'Ksilv'
)
Best Answer chosen by Karen Silva
Narender SinghNarender Singh
Try like this:
AND(
RecordType.Name = "PUT_RECORDTYPE_NAME_HERE", 
ISCHANGED( CloseDate  )
$User.Alias = 'Ksilv'
)

Hardcoding IDs is a bad practice.