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
anvesh@force.comanvesh@force.com 

Need validation rule for this ?

need for only users assigned to 2 certain roles can create ‘private’ Contacts (Contact records with no associated Account). 
Anupam RastogiAnupam Rastogi
Hi Anvesh,

Here is the Validation Rule Error Condition Formula that you can use. Just replace the exact Role Ids for the two roles which can create contacts without an Account.
 
IF(ISBLANK( AccountId ) &&  ($User.UserRoleId == [RoleId1] || $User.UserRoleId == [RoleId2]), False, True)

Thanks
AR

If you found the reply useful that helped resolve the problem, then please mark it as best answer.