- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2022 02:16 AM
I have created 2 UI Action Buttons "Approve"& "Reject" in sc_req_item table:
How ever when I am checking the service portal only Approve button is visible and Reject button is not visible:
Reject button is configured as below screenshot and script and when I uncheck the "Client" option it is appearing but then it is not working as expected.
SCRIPT:
function testComments() {
if (g_form.getValue('u_work_notes_input') == "") {
g_form.addErrorMessage('Please provide your rejection comments in "Work Notes" field.');
return false;
} else {
// Bypass the check if the form has been modified
//g_form.modified = false;
g_form.setValue("u_custom_app_state", "rejected");
// gsftSubmit(document.getElementById('sysverb_update'));
g_form.save();
}
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2022 03:45 AM
Hello All,
I have figured it out.
I have created a "OnSubmit" client script as below:
and uncheck the "Client" option from my button and written a script:
current.u_custom_app_state='rejected';
action.setRedirectURL(current);
current.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2022 03:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2022 03:45 AM
and it is working on ITIL view as well in Service Portal.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2022 04:14 AM
Good to know you got what was expected but I guess original question was to understand why button does not show up. Did you try achieving it with above client script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-01-2022 09:47 PM
Hello Jaspal,
Sorry, If I was unable to explain my question properly. But my intention was to make it visible in service portal and work as expected.
and yes, I made the UI action button as server side only and write the below code in UI action:
current.u_custom_app_state='rejected';
action.setRedirectURL(current);
current.update();
and made a client script UI Type as "ALL" and write the client side code there with my condition.