
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2015 06:39 AM
Can we use "Current" object in Script Include? Please be specific. Yes or No.
If 'Yes', then how? Shouldn't we need to pass the "Current" object to the function or instantiate a GlideRecord object in the script include function?
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2015 09:48 PM
Indeed. Here goes an example using a classless Script Include:
Script include Name: sayHello
Script:
function sayHello(){
gs.addInfoMessage(current.number);
}
I can then call that script include from an incident onBefore insert/update Business Rule with the script:
function onBefore(current, previous) {
sayHello();
}
And upon an insert or update of an incident it will display the incident number as an Info Message in the screen.
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2015 09:57 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2016 11:42 PM
Here is the champ.! Thanks berny. it was much needed for me.
Regards,
Atul Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2016 08:02 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2015 11:13 PM
So if i call this script include from any br(associated with a particular incident), Can it recognise the incident?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2015 11:19 PM
It works only for classless scripts. That is script include with Class.create(); statement