UI Action to open all in cmdb_ci table

Daryll Conway
Giga Guru

I need a little help with a UI Action script. I need the script to open the one 2 many slushbucket view as below

Slushbucket.PNG

This is meant to display the whole cmdb_ci list but as I have a filter on my related list I can't seem to remove the filter and show all.

Related.PNG

My UI script is as follows:

var uri = action.getGlideURI();
var path = uri.getFileFromPath();
uri.set('sysparm_m2m_ref', current.getTableName());
uri.set('sysparm_collection_related_file', current.getTableName());
uri.set('sysparm_stack', 'no');
action.setRedirectURL(uri.toString('sys_m2m_template.do'));

 

Can anyone suggest how I can get the whole cmdb_ci list to display in the slush bucket.

Also any ideas on how I remove the new button (on the above) without removing it for other related lists that use it.

I saw this current.getRecordClassName() !='incident' On the wiki but I can't set the record class name to cmdb_ci as that would remove it from everywhere.

Any thoughts?

1 ACCEPTED SOLUTION

I don't see any reason why that reference filter would make any difference.   If you personalize the list control do you see the 'Enable edit' button available?   If so, you should click that to enable the standard edit button - there's no need for a custom UI action.   Also, are you 100% certain that you're not seeing all of the CIs in the slushbucket?   Have you tried searching with the filter to see if a specific CI is there?   Often times it will look like you don't have any items in the left-hand side just because the referenced records don't have a display value set.


View solution in original post

7 REPLIES 7

Mark Stanger
Giga Sage

Any reason why you aren't just using the standard related list controls?   You can enable the standard 'Edit' button there and omit the 'New' button as needed.



Personalizing Lists - ServiceNow Wiki


Thanks mark that solves my new button issue but I still have the issue of the slush bucket being filtered. Any idea how to have the filter in the related view but removed when I go to the slush bucket view?


I don't see any reason why that reference filter would make any difference.   If you personalize the list control do you see the 'Enable edit' button available?   If so, you should click that to enable the standard edit button - there's no need for a custom UI action.   Also, are you 100% certain that you're not seeing all of the CIs in the slushbucket?   Have you tried searching with the filter to see if a specific CI is there?   Often times it will look like you don't have any items in the left-hand side just because the referenced records don't have a display value set.


I've tried searching for specific CI's, all I get in the slush bucket is --None--.


When I try and use the filter on CI Name, I get 'The page you are looking for could not be found' with the url


....service-now.com/null_list.do?sysparm_target=cmdb_ci.name.367a5b70367ada80367a8180367aebf0&sysparm_target_value=&sysparm_reference_value=&sysparm_nameofstack=reflist&sysparm_clear_stack=true&sysparm_element=name&sysparm_reference=&sysparm_view=sys_ref_list&sysparm_additional_qual=