How to change the Form - view based on field value
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
I have a Custom table, In that table ticket type(Choice field) have 2 values.
If i select one value it should change the view to another view, if i select 2 value it should change the view accordingly.
Can you please help me to configure it.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago - last edited 2 hours ago
Hi @KeerthiPraV
What's the use-case here?
I tried on the Incident form using an onChange Client Script on the Category field to switch views for hardware and software:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || !newValue) {
return;
}
var view = {
"hardware": "ess",
"software": "major_incidents",
};
var targetView = view[newValue.toLowerCase()];
if (targetView) {
switchView("section", "incident", targetView);
}
}Drawbacks:
1) Does not work when record is new
2) if record exist, need to save the record first and then proceed with change in field which pops up dialog box as shown below, after clicking leave reloads form with changed view.
I searched but could not find workaround for above mentioned draw backs
Instead of switching views, you can use UI Policies to show/hide sections or fields based on values
If this was helpful, please mark it as helpful.
Regards,
Mohammed Zakir
