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
OssieOssie 

Changing Case Owner

Hi,

I want to restrict what Cases users can assign to other users / queues by implementing some logic such as field abc__c = '123' and field xyz__c <> '456' etc.
I have tried validation rules but for this to work my criteria must equal true and so this is not a viable solution.  I believe i can only achive this through triggers.  Could some please advise?
Vamsi KrishnaVamsi Krishna
Hi, not sure why you cannot achieve it with Validation Rules

if you have your validation rule as below, then it will throw an error if abc is not 123 or if xyz is 456.. in other words it will allow users to chnage teh owner only if abc is 123 and xyz is not 456..

AND(
ISCHANGED(OwnerId),
OR(
abc__c <> '123',
xyz = '456'
)
)
OssieOssie
Hi Vamsi,

I have already tried creating a validation rule similer to that of yours and it dont quite work.
Basically User 'A' should only be able to assign a case to User 'B' if the following criteria is TRUE:

AND(
ISCHANGED(OwnerId),
OwnerId <> "005D0000002VTZL",
Parts_Marketing_Code__c = "11901",
OR(ISPICKVAL(Sub_Category__c, "Missing Price"), ISPICKVAL(Sub_Category__c, "Price Query"))
)

this works but the problem is once its assigned to "005D0000002VTZL" then this user can no longer assign the Case to anyone else.  Hence Case is stuck.
Or am i missing something?