Synchronous GlideAjax on OnChange() Catalog Client Script

Lucas Romani1
Tera Contributor

Hi,

 

Is there a way to use the synchronous glide ajax method (getXMLWait()) on OnChange() catalog client scripts for service portal ? What I found searching on community was a "trick" to use getXMLWait() on OnSubmit() catalog client scripts for service portal -> https://www.servicenow.com/community/developer-articles/getxmlwait-alternative-for-service-portal/ta... but I didn't found anything about use on OnChange().

 

Can you help me ?

1 ACCEPTED SOLUTION

Hello,

 

Then as suggested In the onsubmit client script just check if the field is still empty if yes return false else return true.

 

Please mark my answer as correct based on Impact.

View solution in original post

5 REPLIES 5

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

Just wondering why you are not using getXML() on the Onchange client script as the form is not being submitted os it does not really have to wait?

@Saurav11 

Currently I am using getXML() on the script, but the problem is that I don't want that the users have the possibility to submit the form while my OnChange() catalog client script is running. So I have the ideia to use the getXMLWait() to "block" the another users actions until my OnChange() script runs

 

Is the getXMLWait() not working in onchange client script. I believe it should work?

 

Interesting. Make the field which you are populating mandatory? will that not do the trick as with out any value in that field it user will not be able to submit?

 

OR 

 

In the onsubmit client script just check if the field is still empty if yes return false else return true.

 

Let me know what you think of the above.

 

Please mark my answer as correct based on Impact.

@Saurav11 

I tried to use getXMLWait(), but seems that this method doesn't work on Service Portal. 

The variables of the form are already mandatory, but I still face the same issue.