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

Hi abhinary,



thanks for the answer, yes my ui action is on the table change_task.



the close ui action is a liste choice not a list context menu


Abhinay Erra
Giga Sage

Nope there is a list context menu UI action And I have created my own list context menu choice and gave it a condition


current.number=='xxxxxx' and it is working


can you show me what you have did with screen shot please cause it doasn't works for me !


Abhinay Erra
Giga Sage

Here you go



find_real_file.png


have you test it ?


cause it is not working nether for client side or server site



please create 2 task and retry it



thank you