Name

sn_sow_inc.RelatedListCIAssetCandidateFilter

Description

Implements global.RelatedListItemCandidateFilter

Script

var RelatedListCIAssetCandidateFilter = Class.create();
RelatedListCIAssetCandidateFilter.prototype = {
  initialize: function(tableName, parentFieldName, parentRecordSysId, referencedFieldName) {
      this.parentRecordSysId = parentRecordSysId;
  },

  getFilterQuery: function() {
  	var ciSysId = [];
  	var gr = new GlideRecord("task_ci");
  	gr.addEncodedQuery("ci_item.assetISNOTEMPTY^task="+this.parentRecordSysId);
  	gr.query();
  	while(gr.next()) {
  		ciSysId.push(gr.ci_item);
  	}
      return "assetISNOTEMPTY^sys_idNOT IN"+ciSysId.join();
  },

  handles: function(thing) {
      return thing == "ASSET_QUERY_FILTER";
  },

  type: 'RelatedListCIAssetCandidateFilter'
};

Sys ID

b55ded5853f33010ae50ddeeff7b126e

Offical Documentation

Official Docs: