- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2016 09:45 AM
Working through an issue we are having and I am stuck. On the approvers tab for our change requests we have the context menu available with the options of Approve and Reject to make it easier for approvers to approve/reject. When you right click and approve it works fine, but when you right click and select reject an error message of "Record not found" is thrown. If I am on my account (Admin) I can double click and select reject (not right click) and it works as intended and rejects the change. Any ideas of what might be going on? This changed when we went from Calgary to Fuji if that helps at all (We were a few releases behind). Screen shots below so you can see what I am referring to:
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2016 01:51 PM
There is a problem with your action.setRedirectURL() in your ui action. According to the script it is looking for the current record in which state is rejected, but there is no record with state rejected. Because the state of current record was still not set to rejected.
Add these 2 lines before action.setRedirectURL()
current.state="rejected";
current.update();
//then here you copy your action.setRedirectURL() part
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2016 01:56 PM
Ahh yes I see now, it wasn't setting it to rejected before the rest of the code was run. I added your suggested code to the front of it and it works perfectly, THANK YOU THANK YOU THANK YOU!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2016 01:53 PM
Think I got it:
The script on the context UI action is
ction.setRedirectURL("sysapproval_approver.do?sys_id=" + current.sys_id + "&sysparm_query=state=rejected");
// original code
//current.state = 'rejected';
//current.update()
I changed it to:
//action.setRedirectURL("sysapproval_approver.do?sys_id=" + current.sys_id + "&sysparm_query=state=rejected");
// original code
current.state = 'rejected';
current.update()
And it now seems to be working. it was something to do with the first line of code that was added to the UI action

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2016 01:55 PM
see my comments above for the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2016 01:57 PM
Yep got it and marked correct answer, thank you very much!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2016 01:33 PM
I'd also like to point out I didn't create these UI actions LOL they were here before my time, I just get the task of sorting them out