How to hide cancel button on RITM Record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2023 03:47 AM - edited 05-24-2023 04:20 AM
Hi Team,
I want to hide cancel button to particular group of user on some particular catalog items RITM record. How to achieve this req?
Thanks in Advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2023 03:50 AM
HI @Sachin G K1 ,
I trust you are doing great.
Identify the catalog item for which you want to hide the cancel button.
Determine the group of users who should not have access to the cancel button.
Navigate to the catalog item's form in the ServiceNow instance.
Switch to the Form Design view for the catalog item.
Locate the cancel button element on the form.
Open the cancel button properties and find the "Visible" property.
Modify the visibility condition to exclude the group of users who should not see the cancel button. You can use GlideRecord queries or ACL conditions to achieve this.
You can add the below script in script include and call it in UI action condition
if (gs.hasRole('admin')) {
// Show the cancel button for admin users
current.variables.cancel_button.visible = true;
} else {
var userGrp = gs.getUser().getMyGroups();
if (userGrp && userGrp.indexOf('group_name') >= 0) {
// Hide the cancel button for users in the specified group
current.variables.cancel_button.visible = false;
} else {
// Show the cancel button for all other users
current.variables.cancel_button.visible = true;
}
}
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2023 03:56 AM - edited 05-24-2023 03:58 AM
I am unable to find Cancel button of ritm record in form design and is there any general solution for this, so that we can specify the list of catalog item ritm in which we wish to hide