Displayed only when Requested Priority is changed from "Low"

Community Alums
Not applicable

Hi,

I have a requirement where I have a selectBox field 'requested_priority' which is defaulted to 'low'. I have to display a field 'priority_justification if 'requested_priority' changed from 'low. I have written code, but 'priority_justification' is displayed irrespective. Kindly help.

 

Change.PNG

 

function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
      return;
   }
   var rp = g_form.getValue("requested_priority");
   if(rp!='low' || rp!=''){
	g_form.setVisible("priority_justification", true);
   }   
}

 

pirority_1.PNG

 

 

pirority_2.PNG

 

Regards

Suman P.

 

1 ACCEPTED SOLUTION

Harish KM
Kilo Patron
Kilo Patron

Hi @Community Alums You can achieve this requirement with UI Policy which avoids scripting and follows best practice

Create a UI Policy with condition

requested_priority is "low" (select low from drop down)

Apply UI Policy action

create a UI Policy action for variable . Set visible to True

priority_justification

 

Regards
Harish

View solution in original post

1 REPLY 1

Harish KM
Kilo Patron
Kilo Patron

Hi @Community Alums You can achieve this requirement with UI Policy which avoids scripting and follows best practice

Create a UI Policy with condition

requested_priority is "low" (select low from drop down)

Apply UI Policy action

create a UI Policy action for variable . Set visible to True

priority_justification

 

Regards
Harish