Filter out empty locaton types from location options on affected locatiton in MIM workbench

DevtoSME
Giga Guru

I need to filter out all locations that do not have a location type, so they do not appear as options on Incidents, Requests, or the MIM Workbench. I was able to use a reference qualifier for the first two (Incident and Request), but for the MIM Workbench, the locations are coming from the cmn_location table, and there is no reference qualifier available for me to use. How can I achieve this?

 

or set the filter to filer out location type is not empty when its opened?

1 ACCEPTED SOLUTION

Brad Bowman
Mega Patron

You could create a before Query Business Rule on the cmn_location table with a script like this:

(function executeRule(current, previous /*null when async*/) {
	current.addNotNullQuery('cmn_location_type');
})(current, previous);

This would hide the locations without a type system-wide.  There should be a way to add a condition or something to the script to only run it for this modal, or not run it for the table list view and reference qualifiers?

View solution in original post

2 REPLIES 2

Brad Bowman
Mega Patron

You could create a before Query Business Rule on the cmn_location table with a script like this:

(function executeRule(current, previous /*null when async*/) {
	current.addNotNullQuery('cmn_location_type');
})(current, previous);

This would hide the locations without a type system-wide.  There should be a way to add a condition or something to the script to only run it for this modal, or not run it for the table list view and reference qualifiers?

DevtoSME
Giga Guru

thankyou this was easier than doing a view rules. i appreciate it