Global Client Script not working on different view

Anubhav24
Mega Sage
Mega Sage

Hi All,

 

I have a client script which makes Additional Comments mandatory on catalog task form when the task is being moved to closed state, and in one of the view this field "Additional Comments" is not present so when the user closes the task the mandatory check fails.

What can be the solution to this ? Any suggestions 

2 REPLIES 2

Sohail Khilji
Kilo Patron
Kilo Patron

Hi @Anubhav24 ,

 

In this case you need to make sure all of the views which are on the table must have additional comments field included as part of form. or if your want exceptionally want to show additional comments on specific view then create create a UI policy with a advance script checking for view and make field mandatory and setVisible/setDisplay true for additional comments. 

 

I hope this helps...


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

PVJShareKnowled
Tera Guru
if (g_form.isVisible('field')) {

  // check if the field is visible then your logic

}

You can try like above so that your client script will be executed only if the field(additional comments) is visible. In place of 'field', use the actual field name(additional_comments). Hope it helps. 

If this input helped you, please give a thumbs up. It encourages me to answer more questions and support our community.

Regards,


Priyanka Jeganathan