Format Control to Default Category to certain option based off of User Role

by Community Manager on ‎08-21-2012 08:20 AM

Question

Basically when someone clicks to open the New Interaction page (SD.open.interaction).  If they are in the User Role Blue or Red I want Category to default to Red_Blue, otherwise I want Category to default to Black.  

 

Can you see anything thing with my format control for SD.open.interaction ? 

 

if ($G.auth.assignment in $file="Blue" or $G.auth.assignment in $file="RED") then ($category="Red_Blue") else ($category="Black")

Answer

Well, right off the bat, $G.auth.assignment doesn't have anything to do with their assigned user role. And when referencing a global variable, you should not include "in $file" as it is not stored in the current file. And if you want to set the category in the current record, it should reference $file.

 

$G.user.role holds the user role of the current operator.

 

This expression will evaluate the operator's user role and set the category in the ticket:

if ($G.user.role="Blue" or $G.user.role="RED") then (category in $file="Red_Blue") else (category in $file="Black")