- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-06-2015 07:24 AM
Hi All,
Can you anyone please let me know how to call script include from workflow.
Script include:
var HelloWorld = Class.create();
HelloWorld.prototype = Object.extendsObject(AbstractAjaxProcessor, {
helloWorld: function() {
var arr1 = this.getParameter('sysparm_user_name') ;
var values = '';
var array = arr1.split(',');
for(i=0;i<array.length;i++)
{
var the_choice = new GlideRecord('sys_user_grmember');
the_choice.addQuery('sys_id', array[i]);
the_choice.query();
if(the_choice.next()){
values = the_choice.user.user_name.getDisplayValue() + "," + values;
}
}
return values;
},
Thanks in advace
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2022 05:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-06-2015 07:44 AM
Hi Kalyan,
new HelloWorld.helloWorld(a)
In the above script a should be the value you wanted to pass it to script include function
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-15-2022 05:07 PM
Just as a side note, it seems that the only place you can call script includes on a workflow are the Script activities.
The same code just does not run calling it from the code area on an approval activity for example.
The solution was to load the script include on a Script activity and dump the values on the scratchpad and then call these from whenever you need.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2022 05:37 AM
We used a separate function in the same SI , it resolves that issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2022 04:53 AM
Thanks Kalyan, will have that in mind the next time.