The CreatorCon Call for Content is officially open! Get started here.

Community Alums
Not applicable

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'

 

find_real_file.pnga

 

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

find_real_file.png

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

find_real_file.png

 

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

javascript:getHRs();

 

 

find_real_file.png

 

 

Let me know if you guys see any issues.

 

Cheers,

Hardit Singh

Comments
michaelmcaliste
Kilo Guru

Very helpful, you can also use the javascript:functionName(); notation in other places such as setting things like the default value for catalog variables etc.

Community Alums
Not applicable
Noted! Thank you!
Version history
Last update:
‎02-20-2019 02:05 AM
Updated by:
Community Alums