- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2023 10:05 PM
Hi!
In the Portal, we have this requirement in the catalog form where we need to filter the List Collector choices (sys_choice table) based on the value selected in Reference field (practice_group table)
Example:
When Reference field selected "Group 1", the List Collector choices should be [ G1, G2, G3 ]
When Reference field selected "Group 2", the List Collector choices should be [ B1, B2, B3 ]
Can I do this filtering via reference qualifier in the Collector field?
Thank you for your help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2023 02:29 AM
@ss123 : As we discussed I have modified the script to cater to the requirement
var ListChoice = Class.create();
ListChoice.prototype = {
initialize: function() {},
getChoice: function(input_value) {
try {
var private_eui = gs.getProperty('private_equity_aol', '678ea9051b403340fb1fb9dcdd4bcbc6');
var choices = [];
var listvalue = new GlideRecord('sys_choice');
if (input_value == private_eui)
listvalue.addQuery('dependent_value', input_value);
else
listvalue.addEncodedQuery('element=u_transaction_type^name=u_deal_collection^dependent_value=NULL');
listvalue.query();
while (listvalue.next()) {
choices.push(listvalue.sys_id.toString());
}
return choices.toString();
} catch (e) {
gs.log('Error in Script apple: ' + e);
}
},
type: 'ListChoice'
};
Mark this as Helpful / Accept the Solution if this clears your issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2023 10:09 PM - edited 08-31-2023 10:20 PM
Hey @ss123 :
Yes you will be able to do it via a reference qualifier only if you can distinguish the record from the list collector reference table
Like when you select A in reference you need to have a unique filter for those group records that needs to be shown
If you are able to have that data set I can help with you the reference qualifier script part
Mark this as Helpful / Accept the Solution if this clears your issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2023 11:00 PM
Hi @S Goutham
Yes , I added the sys_id of a record value from the reference field in the sys_choice table.
Here is the screenshot of the sample:
This is the current reference qualifier i am using in the list collector field:
javascript:"dependent_value=" + current.variables.u_aol (u_aol is the Reference field)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2023 11:17 PM
@ss123 : The sys_id value used in the dependent value is the reference field value you select right in that case try the below snippet
javascript: "dependent_value=" + current.variables.u_aol.toString();
Mark this as Helpful / Accept the Solution if this clears your issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2023 11:24 PM
@S Goutham The list collector field shows "No matches found" when I added the reference qualifier 😞
javascript: "dependent_value=" + current.variables.u_aol.toString();