Configure Edit Button slush bucket UI Action

Code-Person
Tera Contributor

Hi everyone,

When configuring with a UI Action the Edit button for a related list, the slush bucket on the right side box is pulling records from both the table that we configured and it's child table.

We only want records from the parent table.

parent table: m2m_test_parent

child table: m2m_test_child

we were able to solve this before with an ACL on the child table but that's no longer a viable solution

 

 

 

 

var uri = action.getGlideURI();
var path = uri.getFileFromPath();
uri.set('sysparm_m2m_ref', 'm2m_test_parent');
uri.set('sysparm_stack', 'no');
uri.set('sysparm_collection', 'test_service');
uri.set('sysparm_collection_key', 'service');
uri.set('sysparm_collection_label', 'A Label');
uri.set('sysparm_collection_related_field', 'test_location');
uri.set('sysparm_collection_related_file', 'test_space');
uri.set('sysparm_collection_relationship', '');
action.setRedirectURL(uri.toString('sys_m2m_template.do'));

 

 


Thank you !

 

1 REPLY 1

Abhay Kumar1
Giga Sage

@Code-Person Please add below in your custom UI action, within the UI Action script, add a query condition that filters records by table name, explicitly excluding records from m2m_test_child. For example, you can use addQuery('sys_class_name', 'm2m_test_parent') to restrict results to the parent table only.

Hope this will help you.