Calling Script Include from Module Filter

ashish_rai
Kilo Contributor

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

11 REPLIES 11

Hello Ashish,



I do have the same issue. I am in scoped application



Filter:


Screen Shot 2016-09-14 at 11.59.05 AM.png



Script Include:





  1. function getSameAgencyUsersList()  
  2. {  
  3.   var list=[];  
  4.   var gr=new GlideRecord('x_23191_e_c_c_traveler_profile');  
  5.   gr.query();  
  6.   while(gr.next())  
  7.   {  
  8.   list.push(gr.sys_id.toString());  
  9.   }  
  10.   gs.info('list returning '+list.toString());  
  11.   return list.toString();  
  12. }  


Error:



2016-09-14 11:54:43


Warningorg.mozilla.javascript.EcmaError: "getSameAgencyUsersList" is not defined.
Caused by error in <refname> at line 1


==> 1: getSameAgencyUsersList()

I know this is old, but in case someone else finds it. For a scoped app, add the scope to the call:



javascript:scope.function()