Fields to be mandatory and visible at Task Level to a certain group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2025 12:36 AM
Hi,
My requirement is that some of the catalog variables are to be visible and mandatory to a certain group at Task level. I tried it but it is not working. All the fields are editable and these two required fields are not getting Mandatory. Kindly help.
function onLoad() {
if(g_scratchpad.huwi=='palisetty'){
alert('is equal to');
g_form.setMandatory('installation_upgrade_needed', true);
g_form.setMandatory('allocation_link', true);
}
(function executeRule(current, previous /*null when async*/) {
if(gs.getUser().isMemberOf('SAM ADMIN')){
g_scratchpad.huwi='palisetty';
}
})(current, previous);
All the fields are editable and these two required fields are not getting Mandatory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2025 04:16 AM
Hi @Omkar Kumbhar,
Right now all the variables at the task level are editable, is there any way we can restrict the editable variables to only some and all the list of variables.
Regards
Suman P.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2025 06:47 AM
function onLoad() {
if (g_user.hasRole('sam_admin') || g_user.hasRole('admin')) {
g_form.setMandatory('variables.installation_upgrade_needed', true);
g_form.setMandatory('variables.allocation_link', true);
} else {
g_form.setVisible('variables.installation_upgrade_needed', false);
g_form.setVisible('variables.allocation_link', false);
// Or use: g_form.setReadOnly(...) if you want them visible but not editable
}
}
I try to use just onLoad instead of scratchpad