deepakgarg
ServiceNow Employee
Options
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 09-06-2016 07:25 AM
So, how does the Deadlock Scenario look like?
- Make a variable hidden without providing any default value.
- Next, make the variable mandatory (via UI policy/Client script).
- Now that the variable is hidden, you won't be able to provide a value.
- Since you did not satisfy the mandatory rule for the variable, you won't be able to submit the form.
Eg:
"Working with catalog variables can be a breeze, if you understand how they tend to behave when you set them to 'Mandatory'"
Using Roles to Set Variable to Read-only
Ideally, avoid using 'Create Roles' and 'Write Roles' to make a mandatory variable read-only/hidden. Instead use UI Policies or Client Scripts to achieve the same behavior.
However, if you must use 'Create Roles' and 'Write Roles' for a variable, then always set a default value. This will ensure that the form is allowed to be submitted with the variable's default value.
Dos
Verify the following points to avoid a deadlock situation, for mandatory variables:
- Check whether the variable has 'Create Roles' or 'Write Roles'.
- Check if any UI policies/ Client scripts are hiding the variable or making it read-only.
Don'ts!
- Do not set a variable to mandatory and have a 'Create Role' or 'Write Role' for some specific user role (say, nobody). In this case, none of the users will be able to submit item form because variable will be read-only and mandatory for them.
- Do not hide or set a variable to read-only via UI policy/Client script and then set the same variable mandatory.