How to do export and import the script includes functions to another javascript in servicenow application.
I need to call doMultipy fuction from another javascript file on servive now application. Anyone help on this? Code Snippet
How to do export and import the script includes functions to another javascript in servicenow application.
I need to call doMultipy fuction from another javascript file on servive now application. Anyone help on this? Code Snippet
If you want to call this script include from client side script then enable checkbox "client callable" to True. Then use makeAjaxCall from client side.
If you want this script include to be accessible from other modules then ensure you have selected "All Application Scopes" in the "Accessible from" field of the script include.
I am assuming when you say
from another javascript file
you mean to call this function from something like another script include, UI action, business rules, etc. You dont need to use import/export, you can do so by just creating object of this class:If your script include is
Accessible from: This application scope only
, make sure your caller is also from same scope otherwise it wont allow you to access it.