How to hide similar fields on different conditions present on different section on the Incident
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2024 04:14 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2024 04:18 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2024 04:43 AM - edited 05-27-2024 04:44 AM
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