Calling Script Include from Module Filter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-29-2016 06:10 AM
Hi All,
I am trying to call a script include from module filter using -
javascript:AZChangehelper.getCompanyID()
Script include is client callable and function is returning sys_id of some group. Is it mandatory to have same function name as script include or is there any other way to call script include from module filter.
tried these many options-
javascript:AZChangehelper.getCompanyID()
javascript:gs.inlcude('AZChangehelper'); new AZChangehelper.getCompanyID()
javascript:getCompanyID()
Nothing is working.
Thanks,
ARS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2016 01:47 AM
Hi Mihir,
Module Filter:
javascript:AZgetChangeCAB()
Scripted filter:
I am trying to return the value of sys_property which contains a sys_id of group to module filter. This is not working. In system logs, I can see some warning messages coming-
10:32:48.695: Security restricted: GlideSystem: Security prevented execution of getProperty
So I have 2 issues now...why getProperty is not working and why filter is not working.
Thoughts?
Thanks,
ARS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2016 02:14 AM
1.Remove the filter conditions and save.
2.In the arguments field write
name of CAB Unit = javascript:AZgetChangeCAB().
3.Then in the AZgetChangeCAB script include write,
function AZgetChangeCAB (){
var sysid = "";
var gr=new GlideRecord('sys_user_group');
gr.addQuery(add appropriate condition here);
gr.query();
while(gr.next()){
sysid += (',' + gr.sys_id);
}
return 'sys_idIN' +sysid ;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2016 02:18 AM
Hi Mihir,
GlideRecord is working fine here. I just tested by returning some sys_id's back to filter. But here the problem is I want to return sys_id of property which is stored in sys_property table which is not happening in my case.
And requirement is to create filter instead of argument. Need to have module filter. Any idea why sys_property is not working. Is it mandatory to return array of sys_id...if we return string with one value..will it work ?
Thanks,
ARS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2016 02:26 AM
Yes return from script include should return a list of sys_ids separated by comma.
If you are returning a string value then print a log and make sure the string value contains sys_ids separated by comma.
Thanks,
Mihir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2016 02:28 AM
Ok. Any idea why getProperty is not working in this case. My property contains a sys_id of a group and I want to return that value to filter which is not working in my case. Could you please try to replicate this case in your machine and let me know if its a instance problem or I am missing something here.
Thanks,
ARS