- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2020 09:51 AM
We have a catalog item where the first SCTASK assigned needs to have 3 fields editable (the rest of ours default to read only). When the task is closed (Or for anyone not in the 1st SCTASK assignment group) those fields should no longer be editable. I have the UI policy setup to make these 3 fields editable on the task, but can't figure out how to make the fields read only again when the task is closed.
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2020 11:16 AM
Unfortunately the answers above didn't work for us, but we were able to make it work by doing this:
- Add a Yes/No variable on the catalog item
- Create a Catalog UI Policy on the catalog item to Hide the Yes/No variable
- Applies on a Catalog Item view
- Applies on Requested Items
- On Load
- Reverse if false
- UNCHECK Applies on Catalog Tasks
- Add Yes/No variable to the Actions
- Mandatory - Leave alone
- Visible - False
- Read Only - Leave Alone
- Create another Catalog UI Policy to Show the variables that need to be edited during the task
- Applies on Catalog Tasks
- On Load
- Reverse if False
- UNCHECK Applies on a Catalog Item view and
- UNCHECK Applies on Requested Items
- Add the Policy Actions needed for any variables marking the Read Only field False
- Create a Catalog Client Script to make the variables editable only by specific group
- Assignment group is the sys id for the group
- ops variable indicator is the name of the Yes/No field we created
function onLoad() {
// Business Office Physical Services
if(g_form.getValue('assignment_group') == 'a4789e8c1b04a01043770ed7cc4bcb8e') {
/*g_form.setReadOnly('transfer_date', false);
g_form.setReadOnly('old_workstation_number', false);
g_form.setReadOnly('new_workstation_number', false);*/
g_form.setValue('ops_variable_indicator', 'Yes');
g_form.setDisplay('ops_variable_indicator', false);
} else {
g_form.setValue('ops_variable_indicator', 'No');
g_form.setDisplay('ops_variable_indicator', false);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2020 11:16 AM
Unfortunately the answers above didn't work for us, but we were able to make it work by doing this:
- Add a Yes/No variable on the catalog item
- Create a Catalog UI Policy on the catalog item to Hide the Yes/No variable
- Applies on a Catalog Item view
- Applies on Requested Items
- On Load
- Reverse if false
- UNCHECK Applies on Catalog Tasks
- Add Yes/No variable to the Actions
- Mandatory - Leave alone
- Visible - False
- Read Only - Leave Alone
- Create another Catalog UI Policy to Show the variables that need to be edited during the task
- Applies on Catalog Tasks
- On Load
- Reverse if False
- UNCHECK Applies on a Catalog Item view and
- UNCHECK Applies on Requested Items
- Add the Policy Actions needed for any variables marking the Read Only field False
- Create a Catalog Client Script to make the variables editable only by specific group
- Assignment group is the sys id for the group
- ops variable indicator is the name of the Yes/No field we created
function onLoad() {
// Business Office Physical Services
if(g_form.getValue('assignment_group') == 'a4789e8c1b04a01043770ed7cc4bcb8e') {
/*g_form.setReadOnly('transfer_date', false);
g_form.setReadOnly('old_workstation_number', false);
g_form.setReadOnly('new_workstation_number', false);*/
g_form.setValue('ops_variable_indicator', 'Yes');
g_form.setDisplay('ops_variable_indicator', false);
} else {
g_form.setValue('ops_variable_indicator', 'No');
g_form.setDisplay('ops_variable_indicator', false);
}
}