Dynamic Filter Option Not Returning Results Despite Working Through Background Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2025 04:36 PM
Hi everyone,
I created a custom dynamic filter option to return a list of CSM Account [customer_account] records for a specific persona where they are listed as an account team member with a specific responsibility.
From everything I've researched, I set up everything correctly so just not sure what else to do. When I run the business rule in a background script, it returns the correct Account record sys id that I'm assigned to as a team member with the specific responsibility. But nothing is returned when I use the dynamic filter option.
If anyone with experience with dynamic filter options could lend a hand, it would be very much appreciated.
FYI: In this instance, Account is relabeled as Plan
Dynamic Filter Option:
On-Demand Global Business Rule:
function getMyPlans() {
var plans = new GlideRecord('customer_account');
plans.addEncodedQuery('^RLQUERYsn_customerservice_team_member.account,>=1^type=aa7d2def1bc57610dd96eac2604bcbfd^responsibility=7b2ce1ef1bc57610dd96eac2604bcbc5^userDYNAMIC90d1921e5f510100a9ad2572f2b477fe^ENDRLQUERY');
plans.query();
var myPlans = [];
while (plans.next()) {
myPlans.push(plans.sys_id.toString());
}
return myPlans;
}Related List Query:
Empty Result:
Background Script:
gs.info(getMyPlans());Background Script Result:
*** Script: 0f6f267787c76e50461feb9d0ebb356e
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2025 06:30 AM
For people facing this issue down the line, I eventually figured it out. It was not an issue with the code as I expected, the fix was that instead of containing the code in a global business rule. The code needed to be contained in a script include with these settings:
Glide AJAX enabled: true
Sandbox enabled: true
Accessible from: All application scopes
!! Deleted this specific line of code from script: Object.extendsObject(global.AbstractAjaxProcessor,
