How to direct the user to a specific section of the form (server side) onload
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi,
I have a form with 7 tabs, each tab has business line. When ticket is created, an email sent to the business line manager with the link to the ticket he needs to action on it. I want a way so when the business line manager click on the link it takes him to his designated business line tab.
I tried the business rule but it didn't work
Thanks,
S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
47m ago - last edited 44m ago
If sysparm_active_section was a real url parameter you could just include it in the link, no need to use brs. But I'm not sure it actually exists.
You can use the activateTab(field: string) method of g_form to focus on a section tab by name, you can get the tab name with getTabNameForField.
function onLoad() {
const params = new URLSearchParams(window.location.search);
const section = params.get("sysparm_active_section");
g_form.activateTab(section);
}
Or you can do it by index
g_tabs2Sections.setActive(1)
Not sure about your use case but you might also want to consider views which you can set by the sysparm_view parameter. This can possibly make for better ux