g_form.getValue is not working in Service Portal Catalog Item

saikatmitra
Tera Contributor

Hi Team ,

 

Need help. I am not sure I have built a catalog item and it works fine in CSM portal but not in service portal For example the below code is not working when running from Service Portal view. The alert is not triggered but it is triggered in CSM. Can you let me know why?? This is really weird.

 

var k =g_form.getValue('type_of_operation');
alert(k);

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

please set the UI type =  ALL for your client script

find_real_file.png

Regards
Ankur

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

View solution in original post

8 REPLIES 8

It is not working. System is throwing alert but it is also allowing to submit the form something that could be prevented when we use getXMLWait along with onSubmit client script.

Hi,

you shall call glideajax in onChange client script not in onSubmit.

 

@saikatmitra 

GlideAjax with Asynchronous won't work in onSubmit

Please move your code to onChange of the variable which you are trying to validate

Regards
Ankur

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

I see but there are certain validation in my requirement which should be validated while form submission. Isn't there any way we can control the return in asynchronous glideajax while getXML method is fetching the value??