
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2022 08:25 AM
Hello,
I can't set a new Focus on the different tabs of the incident page (ex : When the status is resolved the Resolution Information tab is displayed)
I found the script that could apply it but impossible to make it work with a script client.. I don't know what I'm doing wrong.
Someone would know how to do this and guide me?
Thank you !
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2022 10:17 AM
Super efficient !
Here the script at the end.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if(newValue == 6) {
g_tabs2Sections.setActive(2); //Resolution Information tab
}
}
Thanks a lot for your help !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2022 08:48 AM
I am using a couple of similar scripts to set focus depending on record values. Here is an onChange Client Script as an example.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if(newValue == 3) {
var close = g_tabs2Sections.findTabIndex('close_code'); //find id of tab with named field
g_tabs2Sections.setActive(close); //set focus to the tab
}
}
Also, keep in mind that the "index" starts at 0 like in this example
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if (newValue == 1) { //if on hold awaiting Caller
g_tabs2Sections.setActive(0); //set 'default' active
setTimeout("var refocus = document.getElementById('incident.u_caller_contacted');refocus.focus();", 0);
}
if (newValue == 3) { //if on hold awaiting Problem
g_tabs2Sections.setActive(1); //set Related Records active
setTimeout("var refocus = document.getElementById('sys_display.incident.problem_id');refocus.focus();", 0);
}
if (newValue == 4) { //if on hold awaiting Vendor
g_tabs2Sections.setActive(0); //set 'default' active
setTimeout("var refocus = document.getElementById('incident.u_vendor_incident_number');refocus.focus();", 0);
}
if (newValue == 5) { //if on hold awaiting Change
g_tabs2Sections.setActive(1); //set Related Records active
setTimeout("var refocus = document.getElementById('sys_display.incident.rfc');refocus.focus();", 0);
}
}
So you can go by the name or the index value.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2022 08:51 AM
This appears to be using dom manipulation. On the form for the client script add a filed called Isolate script and uncheck it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2022 10:00 AM
Thanks a lot for your answers. I unchecked the Isolate Script but I still have some work to do to configurate my script. I have a question for you Ian about the value
(newValue == 3)
Is it a reference to the value of the choice list of the Field State ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-22-2022 10:11 AM
Those are the State values on our tables; 3 being a State of "On hold" for Incident.
State of Resolved would be 6 for Incident.