Need details about acRequest() and g_filter

rhofing
Tera Contributor

I have recently been looking into scripting list collectors and I have come across scripts that use g_filter and acRequest(). Regarding g_filter I was trying to find a list of all its methods, but was not able to find such a list. Regarding acRequest() I was unable to find any information at all. I would appreciate any help on this. Thanks!

Ric

4 REPLIES 4

bianca_vaccarin
ServiceNow Employee
ServiceNow Employee

Could you share the link to the list or materials you found?


Here's one resource I bet a lot of people are using: https://www.servicenowguru.com/scripting/client-scripts-scripting/changing-filter-list-collector-var...



Here's one script from the site:



function onChange(control, oldValue, newValue, isLoading) {


      //Apply a filter to the list collector variable


      var collectorName = 'configuration_items';


      var filterString = 'name!=NULL^sys_class_nameANYTHING';


     


      //Try Service Portal method


      try{


              var myListCollector = g_list.get(collectorName);


              myListCollector.reset();


              myListCollector.setQuery(filterString);


      }


      //Revert to Service Catalog method


      catch(e){


              //Find and hide the filter header elements (optional)


              //Simple method for items with only one list collector


              //$('ep').select('.row')[0].hide();


              //Advanced method for items with more than one list collector (more prone to upgrade failure)


              //var el = $('container_' + g_form.getControl(collectorName).id).select('div.row')[0].hide();


             


              //Reset the filter query


              window[collectorName + 'g_filter'].reset();


              window[collectorName + 'g_filter'].setQuery(filterString);


              window[collectorName + 'acRequest'](null);


      }


}


Nothing in all that explains why the acRequest function is used


: /



acRequest > like asynchronous Request ?


MS12
Kilo Sage

10 years later I'm looking for answers to the same question. Anyone knows answer to this question?