Why setDisplay() method is not working?

Ankita28
Giga Contributor

The below client script is for service portal in which setDisplay() method is not working.

Could anyone please help?

find_real_file.png

find_real_file.png

Thanks,

Ankita

11 REPLIES 11

Jaspal Singh
Mega Patron
Mega Patron

Hi Ankita,

 

Are you getting the alert correctly? If so, can you ensure the Isolate script field on the Client script is set to False. It is True by default.

It may not be available on the form you can add it to the form or update the same from List View.

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Ankita,

Few things to check

1) is that variable name correct u_source and u_new_source

2) Is alert coming for if or else

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur,

Yes the both points that you have mentioned are working fine.But still script is not working.

Thanks,

Ankita

Willem
Giga Sage
Giga Sage

SetDisplay is not supported in Mobile/Portal.

 

Use:

g_form.setVisible(fieldName, isVisible)