- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 06:00 AM
Hello,
I am trying to configure UI action so that when "reject" button is clicked the status (u_reject_reason field) changes from "Requested" to "Rejected" however I am not able to save this change.
when i go back to see the record details it s back to "requested" state:
here is the script:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 06:22 AM
Hello @hadron_collider ,
Please refer to my previous screenshot for this.
If the above solution resolve your issue, Please mark the solution as 'Accepted Solution' and also mark it as 'Helpful'.
Thank You!
Prathamesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 06:09 AM
Hello @hadron_collider ,
UI action is a Server Side scripting method. So rather than using 'g_form', You can use 'Current'. Please follow the below script to set the values as per your requirement.
current.u_reject_reason = "rejected";
current.update();
gs.addInfoMessage('This record has been Rejected');
If the above solution resolve your issue, Please mark the solution as 'Accepted Solution' and also mark it as 'Helpful'.
Thank You!
Prathamesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 06:17 AM
Hi!
Thank for checking but I tried this as well and it does not work at all. In fact when I click on the button even the status does not change
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 06:20 AM
Hello @hadron_collider ,
You can refer to the below screenshot for your UI Action configuration.
If the above solution resolve your issue, Please mark the solution as 'Accepted Solution' and also mark it as 'Helpful'.
Thank You!
Prathamesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 06:16 AM
The above script should work with 2 below configurations
1) Client checkbox checked
2) Onclick field should have reject()
please share the UI action configuration screenshot for the 1st half
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader