Format Control to Default Category to certain option based off of User Role (234 Views)
Reply
Valued Contributor
c911darkwolf
Posts: 233
Registered: ‎08-24-2011
Message 1 of 6 (234 Views)

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

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")

 

Thanks for the help!

Please use plain text.
Honored Contributor
John Stagaman
Posts: 3,325
Registered: ‎07-13-2007
Message 2 of 6 (230 Views)

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

[ Edited ]

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")

----------------------------------------------------
Kudos - what, where, how, and why
Want Good Answers? Ask Good Questions...
Please use plain text.
Valued Contributor
c911darkwolf
Posts: 233
Registered: ‎08-24-2011
Message 3 of 6 (191 Views)

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

That worked great!, but i'm still having 2 issues.  It defaults to Category = incidents when i goto Search for a a Ticket or if i Click the "Change Category" Button when viewing a ticket.

 

 

Anyway around this as well ? 

Please use plain text.
Honored Contributor
John Stagaman
Posts: 3,325
Registered: ‎07-13-2007
Message 4 of 6 (175 Views)

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

[ Edited ]

The problem is that you apparently added the new expression to Master Format control (name="incidents"). 

 

Instead, move the expression to the format control "SD.open.interaction". It will then be executed only when the user is opening a new ticket, and not when the search form is displayed.

 

If you also need the expression executed on update (e.g. when the service desk reviews Self Service tickets), add the expression to the format control "SD.update.interaction".

 

If you have changed the name of the Interaction open and update formats as part of your tailoring, update the corresponding format control records instead of those above (which show the out-of-box form names).

----------------------------------------------------
Kudos - what, where, how, and why
Want Good Answers? Ask Good Questions...
Please use plain text.
Valued Contributor
c911darkwolf
Posts: 233
Registered: ‎08-24-2011
Message 5 of 6 (150 Views)

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

I added it to the SD.open & IM.update Format Controls only.

 

When I click the Category I can pick Red / Blue ect...

 

but  when i click subcategory it bring sup the list of Categories under RED everytime.  Even if i type in Blue. and once I pick my cateogries and go back to the form Category has been changed to RED.   

 

 

I've looked for any kind of format control that might cause this to happen on IM.update,  but didn't see anything that reference category.

Now when i put it in SD.open.interaction it worked great.  When the correct person logged in it defaulted straight to RED or BLUE.   

Please use plain text.
Honored Contributor
Piku
Posts: 3,845
Registered: ‎06-17-2010
Message 6 of 6 (115 Views)

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

Hi,

You have to use apm.quick FC not the IM.update if you want to assign default value at time of open only.
Also it should not be the case that even if you have BLUE then it still show subcategory if RED only.
Subcategory are controlled from the table "subcategory" so check the same for the BLUE category.
If you want to restrict particular category for a user role the you can use the concern IM profile from operator record , here in forms tab just mention the name of categories you want to allow to particular user.


hth,
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation