Get a first look at what's coming. The Developer Passport Australia Release Preview kicks off March 12. Dive in! 

Only new state visible when creating new incidents

Christian22A
Tera Contributor

What is the best approach to limit all users other than admins to only be able to save/submit new incidents in a new state?  The options to change the state to in progress, on hold, resolved or cancelled should not be visible until after the creation of an incident.

1 ACCEPTED SOLUTION

something like this in an onload client script

 

if(!g_user.hasRole('admin') && g_form.isnNewRecord())
{
// set value of state or make it read only
g_form.setValue('state', 1);
g_form.setReadOnly('state', true);
}

 

 

-Anurag

View solution in original post

4 REPLIES 4

Anurag Tripathi
Mega Patron

HI,

You can just hide the state , when user is not admin && incident is new, you can do so via client script.

Will that work for you?

 

-Anurag

something like this in an onload client script

 

if(!g_user.hasRole('admin') && g_form.isnNewRecord())
{
// set value of state or make it read only
g_form.setValue('state', 1);
g_form.setReadOnly('state', true);
}

 

 

-Anurag

Killing it...  Experience.... 

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

Dr Atul G- LNG
Tera Patron

Hi @Christian22A 

 

I am not 100% agree, as this is required to modify the basic functionality of system. If you want to do , you can use BR to hide the rest of state.

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************