How do I hide related list using client script?

Ramesh4
Giga Contributor

Hello all, 

How do I hide related list using client script, in condition? If you please share your ideas that would be greatly appreciated?

 

1 ACCEPTED SOLUTION

dmathur09
Kilo Sage
Kilo Sage

Hi Ramesh,

I would prefer to use a UI policy to hide a related list. Put you relevant condition and in the UI Policy Related List Action add your related list which needs to be hidden.

find_real_file.png

Regards,

Deepankar Mathur

View solution in original post

4 REPLIES 4

dmathur09
Kilo Sage
Kilo Sage

Hi Ramesh,

I would prefer to use a UI policy to hide a related list. Put you relevant condition and in the UI Policy Related List Action add your related list which needs to be hidden.

find_real_file.png

Regards,

Deepankar Mathur

Hello Deepankar,

I really appreciate it.

 

Murthy Ch
Giga Sage

Hi Ramesh,

You can try the below script:

g_form.hideRelatedList("related list name"); 
g_form.hideRelatedLists(); //use this if you want to hide all

 

Thanks,
Murthy

Thanks,
Murthy

Valmik Patil1
Kilo Sage

Hi Ramesh,

You can use below code in client script 

You can use g_form.hideRelatedList('name of the related list') method in UI policy script in true block

function onLoad(){ 
if(g_form.getValue('<name of field>') == ''){

 g_form.hideRelatedList('name of the related list'); 

} 
}

Please let me know if you need any details

Regards,

Valmik