Service Portal is not recognizing setVisible()

melosborne
Mega Expert

Hello all,

I have a record producer that I am using a glideAjax() with in order to contextually populate certain fields in my form. Everything works fine from the Self-Service > Service Catalog side, however, the Service Portal does not appear to be taking g_form.setVisible(). The beginning of my onLoad Catalog Client Script is as follows:

find_real_file.png

This hides the two fields just fine in the Service Catalog form, but is completely ignored in the Service Portal. Later in the client script is code to make the variables visible conditionally, but this is also not working in the Service Portal.

The rest of the client script is carrying over into the Service Portal just fine. Is there another method that I should be using to hide variables in the Service Portal?

Thanks,

Mel

1 ACCEPTED SOLUTION

Mike Allen
Mega Sage

Try it without the variable piece:



function onLoad() {


  var sd = g_form.getControl('short_description');


  sd.maxLength = 80;


}



So, g_form.setVisible('category', false);


View solution in original post

3 REPLIES 3

Mike Allen
Mega Sage

Try it without the variable piece:



function onLoad() {


  var sd = g_form.getControl('short_description');


  sd.maxLength = 80;


}



So, g_form.setVisible('category', false);


Thanks for that! While variables.<fieldname> works on the service catalog form, it wasn't working for the Service Portal. Removing the "variables." seems to have done the trick.



Thank you!