logo

NJP

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'

imagea

  • The name of the Script Include should be the function name you are trying to create

image

  • 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)

image

  • After you write the function call the function in Report/Background script/Business Rules like screenshot below

javascript:getHRs();

image

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