How to Dynamically Load Related Lists Based on User Selection to Improve Form Performance?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2024 08:35 AM
Hi everyone,
I'm working on optimizing form load performance in ServiceNow, as several related lists are causing significant delays. To resolve this, I’d like to add a dropdown on the form that lists all related lists. Only the related list selected from this dropdown should fetch and display data, while others remain inactive until explicitly chosen by the user.
Here's the approach I’m considering:
- Add a dropdown/choice field listing all related lists.
- Initially, hide all related lists and prevent any data from being fetched for the related lists.
- When a related list is selected from the dropdown, only that list should fetch and display data, while all others remain unloaded.
I've explored options like g_form.setVisible() and g_form.refreshRelatedList() to control the display and loading of related lists dynamically based on user selection. However, I want to ensure that no data is fetched for any related list when the form first loads unless it’s explicitly selected.
It’s important to note that creating a separate view or using the glide.ui.defer_related_lists variable with 'deferred' or 'ondemand' settings isn't a viable solution for this use case. The only acceptable solution is to completely stop the fetching of records for all related lists on form load, and only fetch records for the related list that the user selects from the dropdown.
Has anyone implemented something similar or have recommendations for achieving this efficiently without manipulating the DOM directly?
Thank you in advance for your guidance!
Ghazali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2024 09:57 AM
Hi @Ghazali ,
To optimize the loading of related lists on record pages, set the user preference "glide.ui.related_list_timing" to "ondemand" and set it to system level by setting system value to true. This ensures that related lists are only loaded when users explicitly request them. Additionally, check the "system" field and delete user preference records where the system field value is set to false. By doing so, related lists won’t load automatically unless users change their preference
Regards,
Chaitanya
Please mark my answer as correct and helpful if it works for you.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2024 11:10 AM
Hi @Chaitanya ILCR , thanks for the response. But as I mentioned in the post creating a separate view or using the glide.ui.defer_related_lists variable with 'deferred' or 'ondemand' settings isn't a viable solution for this use case.
Ghazali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2024 11:41 AM