- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2022 10:20 AM
Hi,
How to hide a choice value (Linux) on the list view for a user with non admin access ?
On form I used client script onLoad but it's not working on onCellEdit.
var adminUser= g_user.hasRole('admin');
if (!adminUser){
g_form.removeOption('operation_system', 'Linux');
}
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2022 10:58 AM
Hi kris,
Create OnCellEdit Client Script:
select field - operation_system
script:
function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
var saveAndClose = true;
//In Place of "10" add your Linux value
if ((newValue == '10') && (g_user.hasRole('admin'))) {
saveAndClose = true;
} else {
alert('Only admin can select this choice');
saveAndClose = false;
}
callback(saveAndClose);
}
If my above response is helpful, then Please mark as Correct Answer/Helpful.
Please check and let us know.
Thanks 🙂
Shakeel Shaik 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2022 10:49 AM
you can't remove the choice.
you can restrict the user to select particular choice through onCellEdit
Shakeel Shaik 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2022 10:54 AM
Create OnCellEdit Client Script:
select field - operation_system
script:
function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
var saveAndClose = true;
//In Place of "10" add your Linux value
if ((newValue == '10') && (g_user.hasRole('admin'))) {
saveAndClose = true;
} else {
saveAndClose = false;
}
callback(saveAndClose);
}
If my above response is helpful, then Please mark as Correct Answer/Helpful.
Please check and let us know.
Thanks 🙂
Shakeel Shaik 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2022 10:58 AM
Hi kris,
Create OnCellEdit Client Script:
select field - operation_system
script:
function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
var saveAndClose = true;
//In Place of "10" add your Linux value
if ((newValue == '10') && (g_user.hasRole('admin'))) {
saveAndClose = true;
} else {
alert('Only admin can select this choice');
saveAndClose = false;
}
callback(saveAndClose);
}
If my above response is helpful, then Please mark as Correct Answer/Helpful.
Please check and let us know.
Thanks 🙂
Shakeel Shaik 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2022 11:04 AM
Hi Kris,
If my above response is helpful, then Please mark as Correct Answer/Helpful.
Please check and let us know.
Thanks 🙂
Shakeel Shaik 🙂