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
TobyMcTobyMc 

Problem with Stopping Workflow rules using NOT ($User.UserRoleId= "00E20000000vkp7"),

I have multiple work flow rules that look at fields to see if they have changed. If they have changed and an ID number is greater than 0 then an email alert is triggered.

 

I want to stop these alerts happening if a person with a particular role in the organisation has changed the data.

 

This is the rule criteria, however even though it states NOT user role = certain role it still generates email trigger and therefore email alert. 

I am pretty new to Salesforce and wondered if anyone new what I was doing wrong?

 

AND(
NOT ($User.UserRoleId= "00E20000000vkp7"),
LEN(Ulla_ID__c) > 0,
OR(
ISCHANGED(BDM__c )
))

 

 

thanks

 

TobyMc

Message Edited by TobyMc on 02-19-2009 03:08 PM
MarkSilberMarkSilber

I think you could use the following. You don't need the OR and can get rid of the "NOT" and use " <> " instead. I didn't test this, but the logic is: If the User Role is not equal to 00E20000000vkp7 AND Ulla_ID__c is not null AND the BDM__c has changed.

 

 

AND($User.UserRoleId <> "00E20000000vkp7",
LEN(Ulla_ID__c) > 0,ISCHANGED(BDM__c))

 


 

 

Hope this solves the problem. To help testing, you can turn on the debug logs for the user you are testing this with to see exactly how the validation rule is being evaluated.

Message Edited by Mark Silber on 02-19-2009 07:08 PM
Message Edited by Mark Silber on 02-19-2009 07:08 PM