list context menu: use 'current' in the condition field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 06:52 AM
Hi everyone,
Im trying to creat a Ui action (list context menu), this gonna be apply for a related list in some form for example change_request and change_task, so when i right-click on some row in the related list i will see my ui action in that menu, i know that i can control its visibility by scripting in the condition field.
For example if i want to show it for users that have the role 'some_role' i have to write in the field condition this: gs.hasRole('some_role') .
I can also control visiblity by accessing to the parent that is 'change_request' in this case by typing 'parent' form example:'parent.active'.
but i can't access to the information row (record in the related list 'change_task') by typing the word 'current' as in the form button.
i read in the wiki this:
- 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.
What i want is to control visibility in function of some information of the row.
Example:
task1 , number = 1
task2 , number = 2
task3 , number = 3
what i can write in the condition field to show that list control context for the task that its number is 2 , or what is the alternative of that ?
usualy for a simple form button we do this : current.number = 2.
What i can do here pls ?
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 07:05 AM
Check the section 3.1.3 .It may be helpful.
http://wiki.servicenow.com/index.php?title=Context_Menus#gsc.tab=0

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 07:53 AM
Hi Paul im working on ui action of type liste context menu not a context menu
thank you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 07:30 AM
Is your UI action on change_task table?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2016 07:33 AM
Use of current should work in the list context menu type UI actions. See the Close Task UI action on chnage_task table for reference.