M2M Slushbucket (sys_m2m_template) not loading left side records for KB articles
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
I am working on a custom UI Action to add Knowledge Articles to a Change Request using an M2M table (task_rel_kb). in service operations workspace. I am attaching screenshots for reference, on the change request table for the related knowledge related list we need to add the ADD button, and this add button if user click it should show all the published articles
My M2M table structure is:
Parent field: parent (Reference to Task / Change Request)
Child field: child (Reference to
kb_knowledge)Table: task_rel_kb
I created a client-side UI Action that opens the slushbucket (sys_m2m_template.do) to allow users to select Knowledge Articles.
Below is the script I am using:
function onClick() {
var currentSysId = g_form.getUniqueValue();
var m2mURL =
'/sys_m2m_template.do?' +
'sysparm_m2m_ref=task_rel_kb&' +
'sysparm_collection=change_request&' +
'sysparm_collectionID=' + currentSysId + '&' +
'sysparm_collection_key=parent&' +
'sysparm_collection_related=kb_knowledge&' +
'sysparm_collection_related_field=child&' +
'sysparm_collection_label=Knowledge Articles&' +
'sysparm_query=workflow_state=published^active=true&' +
'sysparm_collection_related_display=number,short_description&' +
'sysparm_m2m_query=parent=' + currentSysId + '&' +
'sysparm_stack=no&' +
'sysparm_referring_url=' + location.pathname;
top.window.open(m2mURL, '_self');
}Current behavior:
The slushbucket opens successfully.
The right side shows already linked Knowledge Articles correctly.
However, the left side (available records) either:
stays in “Loading…” state, or
shows empty even though there are multiple published Knowledge Articles.
What I have already verified:
The
childfield correctly referenceskb_knowledge.The
parentfield correctly referencestask(Change Request).There are published and active KB articles available.
The user has access to those Knowledge Bases.
The M2M table only contains expected relationships.
Expected behavior:
Left side should display all available published Knowledge Articles.
Right side should show only already linked articles.
Could someone help identify what might be missing or incorrect in this setup? Is there any additional parameter or configuration required for sys_m2m_template to properly load the left side records?
Thanks in advance!
