To hide an choice in reference field

Anitha H V
Giga Expert

To hide a choice from the reference filed for a particular option in the select box field

when the type select box field has the option as B . I do not want the option "Nauru" to be displayed in the reference field place.

find_real_file.png

1 ACCEPTED SOLUTION

Chetan Mahajan
Kilo Sage
Kilo Sage

Hi Anitha,

                 You have to create script include and call it from ref qual place (variable) like below

javascript: new ReferenceQualifierCheck().checkCity(current.variables.work);find_real_file.png

Create Script include as below

var ReferenceQualifierCheck = Class.create();
ReferenceQualifierCheck.prototype = {
initialize: function() {},

checkCity: function(option) {
gs.info("Check Option" + option);

if(option == 'b'){ // backend value of work->b
return "nameNOT LIKENauru";  // filter query from ref table
}
else{
return "nameISNOTEMPTY";
}
},
type: 'ReferenceQualifierCheck'
};

Kindly mark correct and helpful if applicable

View solution in original post

8 REPLIES 8

Hi Chetan,

How can we add this conditions as well in reference qualifier.

 

Hi Chetan,

 

Thank you so much its working.

Thanks Anitha H V

Great 🙂 glad to help 

Mathew Xaviour
Tera Contributor

This is my code but it's not working and I'm using order guide and based on first form field selection the second form's field should be filtered which is a refernce field 

var ReferenceQualifierCheck = Class.create();
ReferenceQualifierCheck.prototype = {
    initialize: function() {},

    checkCity: function(option) {
        gs.info("CheckOption " + option);

        if (virtual_environmene == 'aws') { // backend value of work->b
            gs.info("sq");
            return "u_qs_locationid!=NULL^nameSTARTSWITHaws";


            // filter query from ref table
        } else {
            return "nameISNOTEMPTY";
        }
    },
    type: 'ReferenceQualifierCheck'
};