sysparm_fixed_query is not working in UI Action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2025 01:57 AM - edited ‎07-31-2025 01:58 AM
I have created the following UI Action:
var fUtil = new FacturacioUtils();
var tasquesFacturades = fUtil.tasquesFacturades(current.projecte.toString());
var query = 'top_task=' + current.projecte + '^sys_idNOT%20IN' + tasquesFacturades.join(',');
var url = gs.getProperty('glide.servlet.uri') + `sys_m2m_template.do
?sysparm_fixed_query=` + query + `
&sysparm_m2m_ref=x_tntsl_tmn_factur_facturacio_m2m
&sysparm_collectionID=` + current.sys_id + `
&sysparm_collection=x_tntsl_tmn_factur_factures
&sysparm_collection_key=x_tntsl_tmn_factur_factures
&sysparm_collection_related_file=planned_task
&sysparm_collection_related_field=planned_task
&sysparm_stack=no `;
action.setRedirectURL(url);
Nonetheless, when I launch this UI Action the filter does not apply. I am sure query is generating right because if I change "sysparm_fixed_query" by "sysparm_query" it works fine, and I cannot create a before query BR because the tables I am using are in scope application. Does anybody know why "sysparm_fixed_query" is not working? Do you know how to fix it?
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2025 03:18 AM
I suspect sysparm_fixed_query works well only when it's used in left nav module and not via redirection.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader