How to call script include from Business RUle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2020 12:17 AM
How can we call script include from Business rule.Please providee syntax for that
- Labels:
-
Customer Service Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2020 12:22 AM
Example :
Script Include Name = My script
Function name in Script Include = myfunction()
var x=new My script();
x.myfunction();
Note : Otherwise you can use gs.includes in BR or above one by Creating the object of Script Includes in BR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2020 12:31 AM
Hi Lucky,
the syntax is simple
Refer example below
Script Include:
var MyScriptInclude = Class.create();
MyScriptInclude.prototype = {
initialize: function() {
},
myFunction: function(){
gs.info('Script Include called');
},
type: 'MyScriptInclude'
};
How to call from BR:
new MyScriptInclude().myFunction();
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2021 10:54 AM
May I know how can we get the response from Script include to Business rule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2021 10:22 PM
Hi,
you can return value from the script include function and hold it in some variable and then use in BR
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader