client callable script include not working in scoped application.

Ubada Barmawar
Giga Guru

Hi everyone,

 

I'm working on a custom table inside scoped application, and I'm trying to execute an OnSubmit client script  which calls script include (defined in same scope), but so far.. either I got null response or no response at all. below are my scripts which are pretty simple but not behaving as expected. basically Im trying to make attachment mandatory on form.

 

client script:

UbadaBarmawar_0-1712603329419.png

 

script include:

UbadaBarmawar_1-1712603542205.png

 have referred multiple community articles and solved queries, nothing seem to work. "sys_attachment" is made available to all scopes.

 

Regards,

Ubada Barmawar.

 

13 REPLIES 13

James Chun
Kilo Patron

Hi @Ubada Barmawar,

 

Note that onSubmit Client Sscript does not work with AJAX - https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0783579

 

There may be nothing wrong with your script, try printing out some logs in the Script Include to check its functionalities.

 

Cheers

sorry to say, but its not working out

maroon_byte
Mega Sage

In the client script you are calling 'hasAttachment' but your script include function name is 'hasAttachments'... 's' is missing in the client script.