Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2023 07:17 PM
Hello,
I need help adding Approval Button on CAB Workbench.
Leads would be appreciated.
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2023 01:36 AM
Hi @Khyati Panchal1 ,
Hope you are doing great.
To add Approval Button on CAB Workbench, we need to create custom UI action:
- create a new UI Action.
- Fill in the required details, and atble and provide on click function.
- in script define on click function with scripting capabilities
// Sample script to handle approval logic
var gr = new GlideRecord('change_request');
gr.get(current.sys_id);
if (gr.canApprove()) {
gr.approve();
gs.addInfoMessage('Change request approved successfully.');
} else {
gs.addErrorMessage('You do not have the required permissions to approve this change request.');
}
​
4. Save the UI Action.
Please mark the appropriate response as correct answer and helpful, This may help other community users to follow correct solution.
Regards,
Riya Verma
Regards,
Riya Verma
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-24-2023 01:36 AM
Hi @Khyati Panchal1 ,
Hope you are doing great.
To add Approval Button on CAB Workbench, we need to create custom UI action:
- create a new UI Action.
- Fill in the required details, and atble and provide on click function.
- in script define on click function with scripting capabilities
// Sample script to handle approval logic
var gr = new GlideRecord('change_request');
gr.get(current.sys_id);
if (gr.canApprove()) {
gr.approve();
gs.addInfoMessage('Change request approved successfully.');
} else {
gs.addErrorMessage('You do not have the required permissions to approve this change request.');
}
​
4. Save the UI Action.
Please mark the appropriate response as correct answer and helpful, This may help other community users to follow correct solution.
Regards,
Riya Verma
Regards,
Riya Verma