Calling a Script Include's function in Report/ Business Rule/ Scripts-Background
Import
·
Feb 20, 2019
·
article
Hi Guys,
I have seen people asking how to call a Script Include function in a report or simply in a background script without creating an object of class. This is quite an easy task, so I thought about writing a short article on this.
- Go to the 'Script Include' section in Application Navigator and click 'New'
a
- The name of the Script Include should be the function name you are trying to create
- A class is created automatically in the script section, remove the entire OOB code and write your own function declaration (remember to select 'Client Callable' checkbox)
- After you write the function call the function in Report/Background script/Business Rules like screenshot below
javascript:getHRs();
Let me know if you guys see any issues.
Cheers,
Hardit Singh
View original source
https://www.servicenow.com/community/developer-articles/calling-a-script-include-s-function-in-report-business-rule/ta-p/2330232