Forum Discussion

HannahWright3's avatar
HannahWright3
Qrew Member
4 years ago

Opening Form to Specific Tab

I am trying to open a form to a specific tab on the form. I am attempting to do this by using a formula field to reference a code page using image onload. Having this tab listed first isn't a solution that will work for me since I plan on eventually using this method dynamically.

My current setup:

Created Rich Text Field:


var text iol = "<img qbu='module' src='/i/clear2x2.gif' onload="javascript:if(typeof QBU=='undefined'){QBU={};$.getScript(gReqAppDBID+'?a=dbpage&pagename=";

var text /iol = "&rand='+new Date().getTime())};">";

$iol & "specifictab.js" & $/iol

Code Page: specifictab.js

$("tab_t4_link a").click(); location.assign('#navTop');​


This is the tab I want to open to:

Other posts I referenced where people were able to successfully do this:

Post 1

Post 2


If anyone has any suggestions I would be very grateful!


------------------------------
Hannah Wright
------------------------------

3 Replies

  • BradLemke's avatar
    BradLemke
    Qrew Assistant Captain
    I have two questions:
    1. Is this method going to be used only on records that already exist, or do you plan to target tabs when 'adding' a record as well?
    2. How do you plan to have users 'access' these records with targeted tabs?  Do they access from potentially hundreds of different reports, or is it only a few?


    ------------------------------
    Brad Lemke
    ------------------------------
    • HannahWright2's avatar
      HannahWright2
      Qrew Trainee
      Thank you for your response Brad!

      1. I have a landing page table which contains a landing page record specific to each user. When the user follows the link I provide them they have 4 forms they fill out. This landing page is the parent record to the 4 different tables that house the individual forms. So the user will click the "add Form One" button on the landing page which will take them to create a new Form One record in the Form One table. When they save they are brought back to the landing page so they can click the "add" buttons for the other 3 forms. So in short, this method will only be used on the landing page which is a record that already exists. There would not be a situation where they would be adding a record.

      2. The users would be accessing this landing page where I am trying to use this method in one of two ways. Either using the link I send to them which is a direct record link or when saving a child record which will direct them back to the landing page.

      In my testing I was successfully able to get your strategy of using a button to trigger the code page to run and move me to the specific tab but when I try to use that same code page with the image onload technique it won't run.

      Here's my current code when trying to use iol instead of a hyperlink:

      var text iol = "<img qbu='module' src='/i/clear2x2.gif' onload="javascript:if(typeof QBU=='undefined'){QBU={};$.getScript(gReqAppDBID+'?a=dbpage&pagename=";

      var text /iol = "&rand='+new Date().getTime())};">";

      $iol & "specifictab.js" & $/iol


      Code Page: specifictab.js

      var nextTabLink=$("li.ui-tabs-selected").next("[style!='display:none']").children("a"); $("#saveAndKeepWorkingMenuOption").click(); var noErrorDialog=$('#qbDialog').length==0; if( noErrorDialog ){ $("#tab_t3_link a").click(); location.assign('#navTop'); };

      ------------------------------
      Hannah Wright
      ------------------------------
      • BradLemke's avatar
        BradLemke
        Qrew Assistant Captain
        If you read the code from that .js page, it might actually be a good thing that it doesn't work.  That code page calls a series of '.click' commands, one of which is the 'save and keep working'.  If '.click' commands could be initiated by an 'onload' command, then your browser would go into an endless loop of saving and saving and saving every time you load a record.

        You may not be able to get around the need for creating a button in each of the child tables to push the user to the next stage of the parent record.

        ------------------------------
        Brad Lemke
        ------------------------------