- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2017 07:18 AM
I am trying to create a Dynamic Reference Qualifier and not having much luck.
(Personal development instance - Helsinki latest patch)
The objective is - on a Task Form - e.g. Incident -
select a "Company" value -
and then use a dynamic filter on the "Business Service" search pop-up to restrict choices to only those services that have their company attribute set to the same value.
My Script Include: (as you can see - I tried various ways to get the company value)
My Dynamic Filter
My Dictionary entry
I have tried lots of permutations but nothing seems to work
Any clues, hints, tips would be most welcome
Best Regards
Kevin
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2017 09:23 AM
Actually.. if you're just trying to filter based on the current company, you don't have to run a lookup script at all.
In your dynamic qualifer, you can just have this one line:
return "company=" + current.company;
When this is the case, I prefer to simplify the whole thing and use an "advanced" reference qualifier instead of dynamic:
javascript:"company=" + current.company
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2017 09:06 AM
Kevin,
You've got a lot of experience on this thread!
Foundational issue:
You've defined a class in your script include, but you're only calling a named method in your Dynamic Reference qualifier.
1. To start, change the "Script" field in your dynamic qualifier to:
new kevGetServicesForCompany().mykevGetServicesForCompany()
2. Then, as Chuck notes, change line 14 to:
services.push(gr.sys_id + '');
3. Finally, you need to say what column you're filtering on (sys_id). Change line 19 to:
return "sys_idIN" + services.join(",");
Let me know how the above work out for you.. it should make your qualifier happy.
[EDIT] I also noticed that you have the tree picker enabled for your field. Just a protip that reference qualifiers can break the tree picker very easily by filtering out "parent" tree nodes. You have to consider that, in this case, if there are parent nodes not assigned to "ACME", then they'll disappear from the resulting list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2017 09:23 AM
Actually.. if you're just trying to filter based on the current company, you don't have to run a lookup script at all.
In your dynamic qualifer, you can just have this one line:
return "company=" + current.company;
When this is the case, I prefer to simplify the whole thing and use an "advanced" reference qualifier instead of dynamic:
javascript:"company=" + current.company
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2017 09:41 AM
Hi Valor,
Should the advanced reference qualifier also work when the company field is a list reference field?
I am trying your suggestion but no services are populated.
Thanks,
Ellie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2017 09:43 AM
I can answer my own question it does; I had a typo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-05-2017 09:44 AM
OMG - One line
Sweet !