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
Newbie_edmNewbie_edm 

how to validate the custom object

Hello,

I would like to have validation rule which allow to modify the record if condition A and B or satisfied, if not it should through validation error message. how can we do that?

example
AND( 
AND($Profile.Id <> 'X',(Text(statusField) ='In Progress')),  /* if both conditions are satisfied then it should allow the record to modify */
AND(Hours__c < Field-hours),                                           
OR($Profile.Id <> 'Y', ISCHANGED(statusField), 
OR($Profile.Id <> 'YY', ISCHANGED(statusField)), 
OR($Profile.Id <> 'XX', ISPICKVAL(statusField,'Approved')) /* if both conditions are satisfied then it should allow the record to modify */ 

))
Raj VakatiRaj Vakati
Try like this 
and add other fields

 you need to use OR conditions
 
OR ( 

AND($Profile.Id <> 'XX', ISPICKVAL(statusField,'Approved')) , 

AND($Profile.Id <> 'X',(Text(statusField) ='In Progress'))



)