Script include

SIVAKARTHICS
Tera Contributor

SIVAKARTHICS_0-1753593096320.png

when i use glide ajax in script include and using client Script onsubmit on form for preventing form submission . when i click order now the form showing this in scoped application what can i do

1 ACCEPTED SOLUTION

Roshnee Dash
Tera Guru

Hi @SIVAKARTHICS 

  1. Accessible from other application scopes

    • Set Accessible from: to “All application scopes”.
    • This ensures that the Script Include can be called from client scripts or other components outside its own scope.
  2. Client Callable

    • Mark the Script Include as Client Callable by checking the Client Callable checkbox.
    • This allows it to be invoked from client-side scripts using GlideAjax.
  3. Extending AbstractAjaxProcessor

    • The Script Include should extend AbstractAjaxProcessor to handle AJAX calls properly.
var Yourscriptinclude = Class.create();
Yourscriptinclude .prototype = Object.extendsObject(AbstractAjaxProcessor, {
    myFunction: function() {
        var param = this.getParameter('sysparm_name');
        // Your logic here
        return "Processed: " + param;
    }
});
Your feedback makes the community stronger! If you found this helpful, marking it as the correct answer helps others.
Stay awesome,
Roshnee Dash

View solution in original post

7 REPLIES 7

Roshnee Dash
Tera Guru

Hi @SIVAKARTHICS 
Your attachment is not visible.
You are using glideajax in script include does this mean  your script include is client callable from on submit client script or what

Your feedback makes the community stronger! If you found this helpful, marking it as the correct answer helps others.
Stay awesome,
Roshnee Dash

james698gof
Giga Contributor

@SIVAKARTHICS wrote:

SIVAKARTHICS_0-1753593096320.png

when i use glide ajax in script include and using client Script onsubmit on form for preventing form submission . when i click order now the form showing this in scoped application what can i do


Hello @SIVAKARTHICS,

If Glide AJAX is used in a Script Include within a scoped app, make sure:

- The Script Include is marked as accessible from other application scopes (`Accessible from:` set to “All application scopes”).
- It's declared as `client callable` for client-side use.
- In your Client Script `onsubmit`, use `return false;` after the GlideAjax call to stop form submission properly.

Double-check these and it should smooth out the process. Let me know if it still acts up—I’ve got you.

Best regards,
James Goff

Roshnee Dash
Tera Guru

Hi @SIVAKARTHICS 

  1. Accessible from other application scopes

    • Set Accessible from: to “All application scopes”.
    • This ensures that the Script Include can be called from client scripts or other components outside its own scope.
  2. Client Callable

    • Mark the Script Include as Client Callable by checking the Client Callable checkbox.
    • This allows it to be invoked from client-side scripts using GlideAjax.
  3. Extending AbstractAjaxProcessor

    • The Script Include should extend AbstractAjaxProcessor to handle AJAX calls properly.
var Yourscriptinclude = Class.create();
Yourscriptinclude .prototype = Object.extendsObject(AbstractAjaxProcessor, {
    myFunction: function() {
        var param = this.getParameter('sysparm_name');
        // Your logic here
        return "Processed: " + param;
    }
});
Your feedback makes the community stronger! If you found this helpful, marking it as the correct answer helps others.
Stay awesome,
Roshnee Dash

Ankur Bawiskar
Tera Patron
Tera Patron

@SIVAKARTHICS 

There is some issue going on in community that images are not visible.

please add it using browse feature and add as attachment to post

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