How to hide category and subcategory from incident form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2024 11:00 PM
Hi Team,
How to hide category and subcategory from incident form.
Need to show both fields once record is created in incident table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2024 11:03 PM
Hi @Gopal14 ,
Write an onload client script as below:
function onLoad() {
if (g_form.isNewRecord()) {
g_form.setVisible("category", false);
g_form.setVisible("subcategory", false);
} else {
g_form.setVisible("category", true);
g_form.setVisible("subcategory", true);
}
}
Mark this as Helpful / Accept the Solution if this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2024 11:13 PM - edited 07-22-2024 11:23 PM
Hello @Gopal14 -
We can achieve this by using UI policy and Client script-
1. UI policy - Set the condition as State is new and make Category and subcategory visible false
2. Client Script -
function onLoad() {
if(g_form.isNewRecord()){
g_form.setVisible('category', true); // Enable Category field
g_form.setVisible('subcategory', true); // Enable Subcategory field
} else {
g_form.setVisible('category', false); // disable Category field
g_form.setVisible('subcategory', false); // disable Subcategory field
}
}
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks,
Pratiksha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2024 11:13 PM
Hi @Gopal14,
please check below client script (onLoad):
function onLoad() {
if (g_form.isNewRecord()) {
g_form.setVisible("category", false);
g_form.setVisible("subcategory", false);
}
else
{
g_form.setVisible("category", true);
g_form.setVisible("subcategory", true);
}
}
Thank you, please make helpful if you accept the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2024 11:50 PM
Hi @Gopal14 you can use on load client script I am sharing code below