How to hide similar fields on different conditions present on different section on the Incident

RevathiV
Giga Expert

I have two fields "Short Desc" and "Desc" on two different sections (A and B) on the Incident form. 

 

I want to hide the two fields in Sec A but display it on Sec B when the ticket is Open. Once the ticket is Closed, the two fields should be visible under Sec B and hidden under Sec A.

 

I tried using Client Script, but the fields are getting hidden and displayed in both the Sections.

 

Could you please give me an idea on how to proceed with this requirement. 

 

Many Thanks

 

2 REPLIES 2

Anurag Tripathi
Mega Patron
Mega Patron

Hi Revathi,

 

That will not possible. Maybe you can create different sections and hide/show them base don states with different set of fields but there is no way to control which section you want the field to be hidden and vice versa

-Anurag

Community Alums
Not applicable

Hi @RevathiV ,

You can create two view for example view 1 and view 2 you can switch them on the basis of ticket state.

If your requirement is to set default view for a specific condition then I suggest you to create View Rule. Follow the below steps

1) Navigate to System UI > View Rules
2) Click New button
3) Set following values
Name : Some meaningful name
Table : <your table name>
Advanced : Checked

 

(function overrideView(view, is_list) {
	if (your condition here like state = "closed") {
		answer = "<type the view1 name>";  // set the new view to answer
		return;
	}else{
                answer = "<type the view1 name>";  // set the new view to answer
         }
})(view, is_list);

 

 

 

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

Thanks and Regards 

Sarthak