UI Action Condition on a specific related list

Taylor W
Mega Expert

Hello! We are trying to hide/show a custom UI Action based on a related list ID. We only want to show that UI Action on a very specific related list.

For example: IF Related List ID is REL:7f22341ca1ba20107f612a6c7e377117

Is there anyway to do this? Thanks!

1 ACCEPTED SOLUTION

Looks like this does not work in scoped apps. To workaround this we made our own function. Below is our script include. 

function isListLabel(RP, label) {
    var sysId = RP.getListControl().getControlID();
    var gr = new GlideRecord('sys_ui_list_control');
    gr.get(sysId);
    var grLabel = gr.getValue('label');
   
    if (grLabel == label) {
        return true;
    }
    return false;
}

 

View solution in original post

6 REPLIES 6

Can you guide me with this script?

Where should I put it, how should I fill it etc?

In case you (or anyone else) is still stuck on this, this code worked for me in my scoped app:

 

function isListLabel(RP, label) {
var sysId = RP.getListControl().getControlID();
var gr = new GlideRecord('sys_ui_list_control');
gr.get(sysId);
var grLabel = gr.getValue('label');

if (grLabel == label) {
return true;
}
return false;
}

isListLabel(RP, "Name of my List");