+ Start a Discussion
Salesforce seekarSalesforce seekar 

validation rule for only purticular users having this profiles can only edit a field

here uid__c is a custom field which is a unique identty number like adhar card , now my requirement is only the users with this profile  can edit this uid__c

can you correct my validation rule . thing i sthat with one profile i am able to change the uid__c , with other profile it is throwing error . 

ans:  
AND( 
$Profile.Name <> 'Partner Manager', 
$Profile.Name <>'Sales Management User', 
$Profile.Name <>'Telephone Ibsales User', 
$Profile.Name <>'ddash Sales User', 
OR ( 
AND ( ISBLANK( uid__c ) = FALSE, 
PRIORVALUE( uid__c ) <> '', 
ISCHANGED( uid__c ) = TRUE), 
AND ( ISBLANK( uid__c ) = TRUE, 
PRIORVALUE( uid__c ) <> '', 
ISCHANGED( uid__c ) = TRUE) 

)
Arunkumar RArunkumar R
Hi Salesforce Seeker,

Could you try the below one,
 
AND($Profile.Name != 'Partner Manager', $Profile.Name != 'Sales Management User', $Profile.Name !='Telephone Ibsales User', $Profile.Name != 'ddash Sales User',
OR(ISCHANGED(uid__c), PRIORVALUE(uid__c ) != uid__c))
ManojjenaManojjena
Hi ,
I think belwo code wil help !!
AND($Profile.Name != 'Partner Manager', $Profile.Name != 'Sales Management User', $Profile.Name !='Telephone Ibsales User', $Profile.Name != 'ddash Sales User',
,ISCHANGED(uid__c),PRIORVALUE(uid__c ) != uid__c)

Let me know if it helps !!
Thnaks
Manoj