Hide/Show tab selection in change_request form

Peter Williams
Kilo Sage

I have read some post on this but none of the solutions are working for me

Created this client script to hide or show when a sub-category is selected on the change_request form:

variable: u_sub_category = "Firm Policy"

find_real_file.png

 

however, when i try it out, the tab still shows:

find_real_file.png

 

and when i select Firm Policy in the sub-category i get this error

find_real_file.png

 

 

what is wrong with my client script.

 

any help will be appricated

 

1 ACCEPTED SOLUTION

Murthy Ch
Giga Sage

@Peter Williams 

You want to hide the Firm policy section when Subcategory is selected as Firm Policy?

If yes you have to hide the section using below syntax:

if(g_form.getValue("u_sub_category") = "Firm Policy")
{
//and in the firm policy section there are some mandtory fields so make them non_mandatory before hiding the section else it wont hide
g_form.setMandatory("field_name",false); //map mandatory fields in firm ploicy section
g_form.setSectionDisplay("firm_policy",false);
}
else
{
//make mandatory and display the section
}

Hope it helps

(=tested)

 

Thanks

Murthy

Thanks,
Murthy

View solution in original post

5 REPLIES 5

Saurav11
Kilo Patron
Kilo Patron

Hello,

Just use the below:-

To hide:-

g_form.setSectionDisplay('sectionname',false);

To show:-

g_form.setSectionDisplay('sectionname',true);

 

Please mark answer correct/helpful based on Impact

yltsai
Mega Guru

Please do the following validations first.

1. Check your Sub-Category choice "Firm Policy" name not the readable "label". 

2. Line 6, please use g_form rather g.form

3. Line 7, if(g_form.getValue('u_sub_category') === "<Firm Policy name>"

4. Check all your UI policies or client scripts to see any mandatory fields in the section "Firm Policy". If there are some to set all mandatory to false

Thank you,

 

Murthy Ch
Giga Sage

@Peter Williams 

You want to hide the Firm policy section when Subcategory is selected as Firm Policy?

If yes you have to hide the section using below syntax:

if(g_form.getValue("u_sub_category") = "Firm Policy")
{
//and in the firm policy section there are some mandtory fields so make them non_mandatory before hiding the section else it wont hide
g_form.setMandatory("field_name",false); //map mandatory fields in firm ploicy section
g_form.setSectionDisplay("firm_policy",false);
}
else
{
//make mandatory and display the section
}

Hope it helps

(=tested)

 

Thanks

Murthy

Thanks,
Murthy

thank you that did the trick