The CreatorCon Call for Content is officially open! Get started here.

hide notes section in problem record

Rajkumar Bommal
Tera Contributor

In problem record, hide the Notes section
when state is equal to '102'. onChange Client script - Conditions

2 ACCEPTED SOLUTIONS

Sid_Takali
Kilo Patron

Hi @Rajkumar Bommal 

To hide your sections is pretty simple. create your UI Policy and Add a condition when state is '102' and make sure to check run Scripts In your true/false sections add your code:

True:
function onCondition() {
g_form.setSectionDisplay('notes', true);
}
False:
function onCondition() {
g_form.setSectionDisplay('notes', false);
}

Regards,

Sid

View solution in original post

Community Alums
Not applicable

Hi @Rajkumar Bommal ,

I tried your problem in my PDI and it works for me please create UI Policy and apply filter condition like - state is assess

 

Add below code 

function onCondition() {
	alert("from UI Policy");
	g_form.setSectionDisplay('notes', false);

}

SarthakKashyap_1-1717137909169.png

 

SarthakKashyap_0-1717137884304.png

Result 

SarthakKashyap_2-1717137988014.png

State is Asses and there is no Notes section available 

 

SarthakKashyap_3-1717138077518.png

When state is not asses it shows notes section

 

 

Please mark my answer correct and helpful if this works for you

Thanks and Regards 

Sarthak

View solution in original post

7 REPLIES 7

Sid_Takali
Kilo Patron

Hi @Rajkumar Bommal 

To hide your sections is pretty simple. create your UI Policy and Add a condition when state is '102' and make sure to check run Scripts In your true/false sections add your code:

True:
function onCondition() {
g_form.setSectionDisplay('notes', true);
}
False:
function onCondition() {
g_form.setSectionDisplay('notes', false);
}

Regards,

Sid

dgarad
Giga Sage

Hi @Rajkumar Bommal 

you can use the below code

 

if (isLoading || newValue === '') {
      return;
   }

   if(newValue == 102){
	g_form.setSectionDisplay('notes',false);
   }

 

 

dgarad_0-1717133941028.png

 

If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Thanks
dgarad

@dgarad 
No its not working 
Notes section displaying

 

Hi @Rajkumar Bommal 

change Onchange client script to onLoad

 

function onLoad() {
   //Type appropriate comment here, and begin script below
   var state= g_form.getValue('state');
   alert(state);

   if(state== 102){
	g_form.setSectionDisplay('notes',false);
   }
   
}

 

 

dgarad_0-1717137180408.png

 

If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Thanks
dgarad