Catalog client script is showing as the script is not VA supported

sharan Prasad
Tera Contributor

"This catalog client script is not VA supported due to the presence of the following variables in the script: setTimeout" is the information message I received when I was scripting for a client script.

setTimeout(function(){ g_form.clearMessages();},3000);

1 ACCEPTED SOLUTION

@sharan Prasad 

why not use GlideAjax in your client script and within the script include function give some 3 seconds delay?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

6 REPLIES 6

Mark Manders
Mega Patron

What is your question? The message states what the issue is/could be. It's unclear what/why you are doing this, and because of that, we don't know what it is you want from us.

Is it really an issue (doesn't VA work correctly with this catalog item) or can't you save the script due to this error? Or are you writing it to work in VA like this?


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

 

Here I was scripting to make the error message to get disappeared in 3 seconds. So for that I used the

script : g_form.addErrorMessage(" ");

setTimeout(function(){ g_form.clearMessages();},3000);

 

Like this setTimeout will not work. As it is showing "This catalog client script is not VA supported due to the presence of the following variables in the script: setTimeout".

Is there any other way to solve this?

Ankur Bawiskar
Tera Patron
Tera Patron

@sharan Prasad 

the error clearly says that function is not supported in VA so you cannot use that

what's your business requirement to give timeout?

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

sharan Prasad
Tera Contributor

Here I was scripting to make the error message to get disappeared in 3 seconds. So for that I used the

script : g_form.addErrorMessage(" ");

setTimeout(function(){ g_form.clearMessages();},3000);

 

And it was not an error, it was showing as infoMessage.