hide/show subcategory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2023 10:08 PM - edited 04-09-2023 10:11 PM
Hello Everyone,
I have worked on a client script where if i select category then subcaegory field is populated.
However when the incident is saved the subcategory field gets hidden again.
How should i keep it on the screen after saving/submit.
For more info i have attached the screen shot and the code of my script.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
g_form.setDisplay('subcategory', false);
return;
}
var val = g_form.getValue('category');
if (val == "incident_outage" || val == "inquiry") {
g_form.setDisplay('subcategory', true);
} else {
g_form.setDisplay('subcategory', false);
}
}
The image 2 shows the subcategory before saving however once this incident gets saved then subcategory is hidden as in image 1.
Please guide.
Thanks in Advance,
Renu.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2023 11:02 PM
Hi @Renu4 ,
This can be achieved by UI policy.
Create a UI policy:-
1. When to apply- category is one of incident_outage, inquiry.
2. UI policy action- subcategory set visible to false.
please mark solution as helpful.
Regards,
Ranjit Nimbalkar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2023 11:35 PM
@Renu4 Did you checked may be there is an existing client script written on submit.
First of all check that otherwise you can achieve this via ui policy when to apply category is one of incident_outage, inquiry.
and in ui policy action set subcategory set visible to false.
Mark my answer correct if you find it helpful.