Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2024 06:30 AM
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.
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2024 06:46 AM - edited 01-04-2024 06:46 AM
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
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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.
