Hide embedded list with UI Policy

JJG
Kilo Guru

Hello,

I have a checkbox field, when it is selected I would like the embedded list underneath to be hidden. How can I do this?

Here is what I have so far in my UI Policy:

Condition: when checkbox is true

Script:

g_form.hideRelatedList('SF Involvement in Non - Criminal Court Actions 28');

Here is a picture of the form:

find_real_file.png

18 REPLIES 18

same script you can use in UI Policy as well, but i would suggest to use onchange client script on your checkbox field. 

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

Are you trying to hide a whole section here? 

If yes, then if a section has multiple spaces in the name it has to be handled differently, wrote a blog on the same

Check this out: Show/Hide Form Sections with Multiple Spaces In the Name

-Anurag

-Anurag

I am not trying to hide a section, i am trying to hide the embedded list

Then setSectionDisplay will not work, check the link shared by Harsh, that shows how to hide the embedded list.

Only make sure that 'isolate script' flag is set to false on your script.

-Anurag

I used the link Harshvardhan sent and the code did not work.

I got this error from my UI Policy:

find_real_file.png

Here is what I have:

var list = $$('div[tab_caption="SF Involvement in Non-Criminal Court Actions 28"]')[0];
    if (list.hasClassName('embedded')) {
        list.hide();
    }