Process Builder/Case Assignment -Validation Issue - Answers - Salesforce Trailblazer Community
Ask Search:
Amanda StewartAmanda Stewart 

Process Builder/Case Assignment -Validation Issue

We are using process builder to trigger our case assignment rules so that we are able to use inline edits. This validation works fine until we put process builder in place and now we recieve this error. Has anyone else experienced this and/or have recommendations. Using the edit button there is no issue and case routes. If I deactivate the validation and do inline edits it assigns correctly without error which tells me there isn't an error in the PB. Reference error and validation below.


User-added image

Validation:

AND(
ISCHANGED( OwnerId ),
OR(NOT(ISBLANK( Owner:Queue.Id)),
AND(Owner:User.Employee_Type__c <> 'Investigator', Owner:User.UserRoleId <> null)),
CASE(RecordType.DeveloperName,
'SISStep1', 1,
'SISStep2', 1,
'SISStep3', 1,
'SISStep4', 1,
'SISPortalStep1RecordType',1,
0) = 1
)
Best Answer chosen by Amanda Stewart
Prabhat SharmaPrabhat Sharma
Hmm.. Your validation rule is speaking something else though. 

Update the validation as below.
 
AND(
ISCHANGED(OwnerId),
CONTAINS(RecordType.DeveloperName,"SIS"),
BEGINS(OwnerId,"005"),
OR(      
      Owner:User.Employee_Type__c <> 'Investigator',
      ISBLANK(Owner:User.UserRoleId)
)
)
Here
- I'm checking If the Owner of Case is an individual user (no need to check for Queue as Queues are allowed as you said).
- If User's Employee Type is not equal to  Investigator
- If the User's role is blank i.e. not a console user. 

If the above conditions are met, then only the validation should fire. 

All Answers

Prabhat SharmaPrabhat Sharma
Hi Amanda,

What is the purpose of your validation rule?
 
Amanda StewartAmanda Stewart
Hi Prabhat! It's to not allow a SIS case to be assigned to a community user that isn't employee type Investigator.

So only console users (accounted for with the role can't be null), colleague with employee type Investigator, or if it assigned to a queue. Does this make sense?
Prabhat SharmaPrabhat Sharma
Okay. That means the SIS cases should only be assigned to Users where Employee Type is equal to Investigator. Correct?

Not to a Queue and not to users whose Employee Type is not equal Investigator. I'm just thinking the other way around to understand. 

 
Amanda StewartAmanda Stewart
No, the case needs to be able to be assigned to all three of those. SIS case can be assigned to Investigator OR console user OR Queue. Just NOT community users.
Prabhat SharmaPrabhat Sharma
Hmm.. Your validation rule is speaking something else though. 

Update the validation as below.
 
AND(
ISCHANGED(OwnerId),
CONTAINS(RecordType.DeveloperName,"SIS"),
BEGINS(OwnerId,"005"),
OR(      
      Owner:User.Employee_Type__c <> 'Investigator',
      ISBLANK(Owner:User.UserRoleId)
)
)
Here
- I'm checking If the Owner of Case is an individual user (no need to check for Queue as Queues are allowed as you said).
- If User's Employee Type is not equal to  Investigator
- If the User's role is blank i.e. not a console user. 

If the above conditions are met, then only the validation should fire. 
This was selected as the best answer
Amanda StewartAmanda Stewart
This appears to be working upon first test!! Thank you so much for your help!