- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2016 10:24 PM
Hi All,
We need to hide/remove the approve/reject when the state is not requested in approval record.
I have tried by giving current.state != 'requested' in OOB two list context menu UI action defined for sysapproval_approver table. But this is not helping. The "current" is not working in list context menu.
We can hide/remove by validating roles(gs.hasRoleExactly("zzz")), but we need to hide/remove it based on state of the approval record.
Is there any other way we can achieve this???
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2016 01:35 AM
Hi All,
Thank you for your wonderful time.
Actually the "current" works in right click context menu. As am having the condition current.state == 'requested' on the UI action approve, the functionality is supposed to hide the context menu "approve" whenever the state is not 'requested'. but instead of the its throwing a "security error" as "Security does not allow the execution of that action against the specified record".
Thanks,
Joshwa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2016 12:36 AM
Can you tell me why do u want that as if you click that approve/reject button in any other status than requested , it will give u security error and action will be aborted..
Mark Correct if it solved your issue or hit Like and Helpful if you find my response worthy.
Thanks,
Deepa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2016 12:44 AM
Hi Deepa,
Requirement is to disable the approve/reject right click context menu when the state is "Approved/Rejected". The approve/reject menu should only show when the approval record state is requested.
Once the requested is approved. It should not rejected/approved from the right click context menu. Right now the right click context menu overriders the approved and rejected
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2016 12:56 AM
The current object is not available for conditions on a list context menu (the List context menu check box is selected). Any use of current on these actions is ignored.
Mark Correct if it solved your issue or hit Like and Helpful if you find my response worthy.
Thanks,
Deepa

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2016 12:43 AM
Hi Joshwa,
The current object is not available for conditions on a list context menu.It is mentioned in wiki (UI Actions - ServiceNow Wiki ) also. But I can see current object in condition field of OOB List Context menus and I am not sure how are they working.
Thanks,
Abhinandan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2016 01:35 AM
Hi All,
Thank you for your wonderful time.
Actually the "current" works in right click context menu. As am having the condition current.state == 'requested' on the UI action approve, the functionality is supposed to hide the context menu "approve" whenever the state is not 'requested'. but instead of the its throwing a "security error" as "Security does not allow the execution of that action against the specified record".
Thanks,
Joshwa