Activate tab in standard service screen

Hi

Is there a way to activate a particular tab in a standard service screen?

In the sample below there is a tab "tasks" (German: Tätigkeiten). We would like to guide the user directly to that tab instead of the first tab:

URL: /scripts/ticket.fcgi?action=viewTableEntry&table=ticket&id=134

I thought to simply add &activePane=2 to the URL, but that does not work.

My question: is there a parameter to activate a tab in the ticket screen?

In custom screens you can do this in the loading script:

// Active pane
Integer activePane = getCgiVariable("activePane").toInteger();
if (activePane > 0)
{
  getHtmlElement("panes").setFieldValue("selected", Map("pane = " + activePane.toString()));
}
// Assuming the panes element is named "panes"

RE: Activate tab in standard service screen

Hi Marc, haven't tried, but I think perhaps you could use a Hook-script to do this. That doesn't require a change to the standard screen.

Von: Frode Lillerud 17. Jan 2020

RE: Activate tab in standard service screen

Yes, that works. Create a new script, and give it the magical include-name "HtmlPage.ej_viewTicket_80.beforePrint".

Then you can go to the standard screen with "&action=viewTableEntry&table=ticket&id=123&activePane=2"

#setLanguageLevel 3;

/*
 * Hook script which executes when the View Ticket page is loaded.
 * IncludeName must be: HtmlPage.ej_viewTicket_80.beforePrint
 */

Integer activePane = getCgiVariable("activePane").toInteger();
if (activePane > 0)
{
  getHtmlElement("panes").setFieldValue("selected", Map("pane = " + activePane.toString()));
}
Von: Frode Lillerud 17. Jan 2020

RE: Activate tab in standard service screen

Hi Frode,

nice, that works fine. Where do you get the "magical include-name" from? Is this baked into service code somewhere? I just found some hints here.

Von: Marc Eberhard 17. Jan 2020

RE: Activate tab in standard service screen

Yes, it's baked in, and it's not always easy to know what name to use and which screens support hookscripts. There seems to be a system of hardcoded name + screen name + event name. There are several events that can be used, but I don't remember what they are.

Von: Frode Lillerud 19. Jan 2020