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

5 REPLIES 5

IvarDonado
Tera Expert

Three easy solutions:

  • Make the state field read only when the record is new and default it to new.
  • onSubmit client script where you check the value of the state field and prevents submission if the record is new (I would add this one to the previous one, in case someone can somehow force the field to be editable on the front-end).
  • Business rule running before the insert that triggers when the state != new and the update is interactive (meaning it was a user), aborts the action and adds a message stating it can't be saving in a state other than new.