- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Can I control (make readonly/mandotory...) variables inside a multi row variable set with a catalog ui policy inside the item and not inside the variable set ?
Im trying to make a variable that in inside a MRVS read-only based on the value of a field that is on the item is this possible ? (Zurich Version)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Seems backwards and unnecessary, since the values in each row are already read-only when viewed on the Catalog Item form. Just create an onLoad Catalog Client Script that applies to the MRVS, which will run when the Add Row button or Edit icon is clicked - so it will be in effect in the add/edit row dialog window:
function onLoad() {
if (g_service_catalog.parent.getValue('var_name') == 'create') {
g_form.setValue('add_remove', 'add');
g_form.setReadOnly('add_remove', true);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago - last edited 3 hours ago
For MRVS rows, you need to use g_form.getSectionCount('access_managment') to get how many rows there are, then loop like this:
Make sure the MRVS name (access_managment) is exactly right (watch spelling and case).
This way, you set the value and make the field read-only for every row in the MRVS.
@F_bio Santos - Please give a Thumbs up and Accepted Solution if you find Helpful! Thanks My Friend!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Yes, we can do read only in multi row variable set from catalog item in Zurich release.
Below screenshots mentions all in Zurich version:
.
Please appreciate the efforts of community contributors by marking the appropriate response as the correct answer and helpful. This may help other community users to follow the correct solution in the future.
********************************************************************************************************
Cheers,
Prashant Kumar
ServiceNow Technical Architect
Community Profile LinkedIn YouTube Medium TopMate
********************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Seems backwards and unnecessary, since the values in each row are already read-only when viewed on the Catalog Item form. Just create an onLoad Catalog Client Script that applies to the MRVS, which will run when the Add Row button or Edit icon is clicked - so it will be in effect in the add/edit row dialog window:
function onLoad() {
if (g_service_catalog.parent.getValue('var_name') == 'create') {
g_form.setValue('add_remove', 'add');
g_form.setReadOnly('add_remove', true);
}