Hide choice from variable dependant on look up select box type variable

Kunal33
Tera Expert

Hi team,

 

we have a variable named product domain which is lookup select box type reference to business capability table and lookup value field is parent. 

 

When we select Utilities  Product in Product domain or onload when Utilities product is coming, we need to hide Planned work from the categories.

 

Kunal33_0-1696833570016.png

 

3 REPLIES 3

Ashutosh C J
Tera Guru

Hi @Kunal33 
Please try this,

AshutoshCJogl_0-1696840909149.png

 

Ashutosh C J
Tera Guru
Please use this code as reference
function
onChange(control, oldValue, newValue, isLoading) {
    //This Script works both during onLoad and onChange
    if (newValue === 'Utilities product') {
        g_form.removeOption('VariableName', 'ChoiceName');
        return;
    }
}

Please mark helpful if this solution is of help for you

Sandeep Rajput
Tera Patron
Tera Patron

@Kunal33 You can choose to create a UI Policy on your Catalog item/Record producer and in the condition field check 

Product Domain is Utilities Product

 

Screenshot 2023-10-09 at 4.28.39 PM.pngScreenshot 2023-10-09 at 4.32.35 PM.png

 

The advantage of using UI Policy over client script is you do not have to define two separate client scripts onLoad and onChange. A single UI Policy would cater to your need.

 

Hope this helps.