- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2023 02:58 AM - edited 04-29-2023 03:05 AM
Dear Experts,
I have total 3 variables,
Variable #1- Name: company; Type: Multiple Choice(None included), Choices (Value): ABC Org, PQR Org, XYZ Org (Order 100, 200, 300 respectively)
Variable #2- Name: job_type; Type: Select Box(None Included), Choices (Value): Dependent, InDependent, Misc (Order 100, 200, 300 respectively)
Variable#3- Name: location_name; Type: Lookup Select Box(None Included; Lookup from table: cmn_location; Lookup value field: Name; No reference qualifier set and No value attributes set).
Requirement is:
If company-ABC Org and job_type-'InDependent' is selected, then display only those 'location_name' (Name) which having Country-'Canada' and 'USA'
If company-XYZ Org and job_type-'InDependent' is selected, then display only those 'location_name' (Name) which having Country-'Italy'
If any/either of 3 provided comapny (ABC Org or PQR Org or XYZ Org) and job_type-'Dependent' is selected, then display only those 'location_name' (Name) which having Country-'Australia'
If any/either of 3 provided comapny (ABC Org or PQR Org or XYZ Org) and job_type-'Misc' is selected, then display only those 'location_name' (Name) which having Country-'Australia', 'Brasil' & 'Japan'
Requesting help on how it can be achieved as I referenced some links just to initiate atleast but unable to get this done. Kindly advise the steps on how this can be achieved .
Thank you in advance. Will mark your response helpful and accepted solution if response helped me on learning.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2023 04:50 AM
@rishabh31 , please try to do it via script include
Adv Ref Qual:
javascript: new AdvRefQuery().getQuery(current.variables.company,current.variables.job_type);
Script Include:
var AdvRefQuery = Class.create();
AdvRefQuery.prototype = Object.extendsObject(AbstractAjaxProcessor, {
getQuery: function(company, jobType) {
if (company == 'ABC Org' && jobType == 'InDependent') {
return 'country=Canada^ORcountry=USA';
} else if (company == 'XYZ Org' && jobType == 'InDependent') {
return 'country=Italy';
} else if ((company == 'XYZ Org' || company == 'PQR Org' || company == 'ABC Org') && jobType == 'Dependent') {
return 'country=Australia';
} else if ((company == 'XYZ Org' || company == 'PQR Org' || company == 'ABC Org') && jobType == 'Misc') {
return 'country=Australia^ORcountry=Brasil^ORcountry=Japan';
}
},
type: 'AdvRefQuery'
});
Hope this helps!
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2023 06:46 AM - edited 04-29-2023 12:00 PM
@rishabh31 , in the variable attributes add this line, it'll work
ref_qual_elements=company;job_type
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2023 03:17 AM
hi @rishabh31 ,
Looks like job for Reference Qualifier. So you need to create script include function where you pass values from variable 1 and 2.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2023 03:36 AM
Thank you @Kamil Smusz sir for the response
Can you help me with the script include as I am unable to pass the values/choices of variable 1 and 2, this is something new for me in script include.
Also do this requirement needs catalog client script as well or only from reference qualifier it can be achieved.
Please help me with steps to achieve this. This will help me to understand and learn.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2023 03:38 AM
Hi @rishabh31 ,
This can be achieved through advance reference qualifier, paste this code in the adv reference qualifier:
javascript:if(current.variables.company == 'ABC Org' && current.variables.job_type == 'InDependent') 'country=Canada^ORcountry=USA';
else if(current.variables.company == 'XYZ Org' && current.variables.job_type == 'InDependent') 'country=Italy';
else if((current.variables.company == 'XYZ Org' || current.variables.company == 'PQR Org' ||current.variables.company == 'ABC Org') && current.variables.job_type == 'Dependent') 'country=Australia';
else if((current.variables.company == 'XYZ Org' || current.variables.company == 'PQR Org' ||current.variables.company == 'ABC Org') && current.variables.job_type == 'Misc') 'country=Australia^ORcountry=Brasil^ORcountry=Japan';
If my answer has helped with your question, please mark it as helpful and accepted solution
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2023 04:01 AM
Thank You @Karan Chhabra6 for your response,
The reference qualifier you provided I pasted in location_name variable, but no desired result.
For testing used: 'If company-XYZ Org and job_type-'InDependent' is selected, then display only those 'location_name' (Name) which having Country-'Italy''
See screenshots below
But location table have only 3 entries with Country Italy
Thank you so much for this reference qualifier. Expecting your further help on this.