+ Start a Discussion
kminevkminev 

Find out if current user is a member of particular group in custom validation rule formula.

Hi,

 

I probably posted this already, but I never got a respond. 

 

Here is my question: I need to check on my custom validation rule's formula if the current user is a member of particular queue.

 

Is this possible to check against the queue in formula and how?

 

Thank you very much.

Best Answer chosen by Admin (Salesforce Developers) 
zen_njzen_nj

I don't think you can reference queue in the validation rule (at least I don't think so).

 

And if that's the case, the only way I can think of is to create a custom field in the Users object and then doing

a little bit of maintenance on it.

 

For example, if you want to check if a user belongs to a "ValidUserQueue" Queue, I would create a checkbox field in the Users object called IsValidUserQueueMember. And then for the users that belongs to this Queue, you would check this field.

 

Then in your validation rule, you would reference or check if user belongs to this particular queue by something like:

 

AND

(

.

.

$User.IsValidUserQueueMember__c

)

 

All Answers

zen_njzen_nj

I don't think you can reference queue in the validation rule (at least I don't think so).

 

And if that's the case, the only way I can think of is to create a custom field in the Users object and then doing

a little bit of maintenance on it.

 

For example, if you want to check if a user belongs to a "ValidUserQueue" Queue, I would create a checkbox field in the Users object called IsValidUserQueueMember. And then for the users that belongs to this Queue, you would check this field.

 

Then in your validation rule, you would reference or check if user belongs to this particular queue by something like:

 

AND

(

.

.

$User.IsValidUserQueueMember__c

)

 

This was selected as the best answer
kminevkminev

Thank you Zen, your suggestion is deffianately a possible approach to my problem.

 

Chetan ChoudhariChetan Choudhari
After creation of Case

1.Current  User can't assign this case to other Users.

2.But Current User can assign the Case to Queue named Refer to Manger

3.Now consider inside the Queue there are three  Users e.g. ABC,XYZ and LMN.
So these members can now assign this case to themselves now

4.Let us consider Now Case is taken by ABC and now after doing some changes case is saved By User ABC(who is part of Refer to Manger )

5. Now ABC wish to assign this case to any Queue or User so He can able to assign it.

Which means that Anyone inside Refer to Manger Queue has ability to assign cases to any Queue and User.
I tried this but for that I have to make changes in User Object.

Can Anyone have better solution than this.

AND(!ISNEW(),Owner:User.Id != $User.Id, ISCHANGED(OwnerId),
Owner:Queue.Name !="Refer to Manager", $User.IsRefer_to_ManagerMember__c !=True)