- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-24-2023 12:18 AM
I have a requirement to hide "Closed Skipped" and Closed Incomplete" options on an SCTASK List View (see picture below) when the "State" field is selected for update.
Is that possible using an OnCell Script? What is your suggestion to fulfill the requirement?
Or should I prevent the state field from being update using an ACL? However, not sure that I have the knowledge to do create the ACL for that particular Catalog item that generated the SCTASK. Therefore, your guidance and assistance will be appreciated. I am using my PDI instance with Tokyo release.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-24-2023 12:28 AM
You can't hide using onCellEdit() but you can restrict selecting them. try the following code, Also if possible try the list_edit ACL as well.
function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
var saveAndClose = true;
if (newValue == 'state_1' || newValue == 'state_2') //Pass the state values
{
alert('Cannot move back to Closed complete/Closed skipped state');
saveAndClose = false;
}
callback(saveAndClose);
}
If I could help you with my response you can mark it as helpful and correct as it benefits future viewers
Thanks,
Sai Kumar B
Community Rising Star 2023 & 2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-24-2023 12:28 AM
You can't hide using onCellEdit() but you can restrict selecting them. try the following code, Also if possible try the list_edit ACL as well.
function onCellEdit(sysIDs, table, oldValues, newValue, callback) {
var saveAndClose = true;
if (newValue == 'state_1' || newValue == 'state_2') //Pass the state values
{
alert('Cannot move back to Closed complete/Closed skipped state');
saveAndClose = false;
}
callback(saveAndClose);
}
If I could help you with my response you can mark it as helpful and correct as it benefits future viewers
Thanks,
Sai Kumar B
Community Rising Star 2023 & 2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-24-2023 12:35 AM - edited ā02-24-2023 12:39 AM
Sai, where do I go to add the onCellEdit script? Also, does this script apply to all SCTASK on the Global Scope? The requirement is to apply the script only to specific Catalog item. Is that possible? Thank you for the collaboration and assistance. Also, where should I go to see the "list_edit" ACL?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā02-25-2023 07:23 AM
- Yes, The script applies to all SCTASKS in List view in the Global scope
- You can apply conditions in the script, the above script I shared is a sample one
- You can create list_edit acl in the Access security control module in the Application navigator, You can refer to the OOB ACLs and create one as per your requirement
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-11-2024 02:52 AM
@Sai Kumar B If want to hide the option for a particular field like it should not be visible in list view also.
Then what steps I have to follow for ?