Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

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

Adil JEBLI
Mega Expert

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

14 REPLIES 14

tanumoy
Tera Guru

Check the section 3.1.3 .It may be helpful.



http://wiki.servicenow.com/index.php?title=Context_Menus#gsc.tab=0


Hi Paul im working on ui action of type liste context menu not a context menu
thank you


Abhinay Erra
Giga Sage

Is your UI action on change_task table?


Abhinay Erra
Giga Sage

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.