List Context Menu Client UI Action

giles_lewis
Mega Contributor

If I create a List Context Menu UI Action, and I specify it as Client (meaning that it will run a client script rather than a server script), then how do I know on which record it is running? My list is a related list. If I use g_form functions, they appear to pull information about the parent record, not the related list row on which I have right-clicked and invoked my UI Action.

1 ACCEPTED SOLUTION

LaurentChicoine
Tera Guru

I'll share my thinking to find this information with you as it was quite simple to find this information.



I simply made a filter on the UI Actions table:



List context menu IS true AND


Client IS true



Then I simply looked inside the OOTB scripts and there seems to be two way to get it:



  1. Using the g_sysId variable which is available (in Helsinki at least)


var sysId = g_sysId;



    2. Using the rowSysId variable if defined, otherwise using gel to get it.


if (typeof rowSysId == 'undefined')


    sysId = gel('sys_uniqueValue').value;


else


    sysId = rowSysId;


View solution in original post

1 REPLY 1

LaurentChicoine
Tera Guru

I'll share my thinking to find this information with you as it was quite simple to find this information.



I simply made a filter on the UI Actions table:



List context menu IS true AND


Client IS true



Then I simply looked inside the OOTB scripts and there seems to be two way to get it:



  1. Using the g_sysId variable which is available (in Helsinki at least)


var sysId = g_sysId;



    2. Using the rowSysId variable if defined, otherwise using gel to get it.


if (typeof rowSysId == 'undefined')


    sysId = gel('sys_uniqueValue').value;


else


    sysId = rowSysId;