Forum Discussion
AlexWilkinson
Qrew Assistant Captain
Michael, two ideas. Without knowing a few details about your app, I am not sure which of the two would work better. Possibly, they both would.
1) Suppose that tab 2 is hidden by your rule, then you might adapt the navigational formula field in my original post to work something like this:
If([Start Tab Completed],
If([Part 1 Completed] and [Part 2 Shown],
If([Part 2 Completed] or not [Part 2 Shown] ,
If([Part 3 Completed],
"Finish",
"Part 3"
),
"Part 2"
),
"Part 1"
),
"Start"
)
Then you would need to create a formula-checkbox field [Part 2 Shown] that evaluates to true when you want that tab to be visible. I often do this to avoid having to create complex show-hide rules within a form. On the form, I put a section that is shown only if the user is an Admin, and add the [Part 2 Shown] field in that section. Finally, the form rule is then very simple: When [Part 2 Shown] is checked, show tab "Part 2". (Disclaimer: I have not actually tried this option, though I am pretty sure it would work.)
2) Somewhat more powerful (but also less transparent!) is a second option, which involves a modification of the script "saveAndNextTab.js". Essentially, the revised script, instead of finding the next tab, finds the next one that is not hidden. Here's the modified script; notice the first line. (Also, as a bonus, I've added a fourth line that scrolls to a place where that tabs will be near the top of the page, which is handy if you have fixed fields above the tab-ribbon and a lot of fields under the selected tab.)
var nextTabLink=$("li.ui-tabs-selected").next("[style!='display:none']").children("a");
$("#saveAndKeepWorkingMenuOption").click();
$(nextTabLink).click();
location.assign("#mainBodyDiv");
1) Suppose that tab 2 is hidden by your rule, then you might adapt the navigational formula field in my original post to work something like this:
If([Start Tab Completed],
If([Part 1 Completed] and [Part 2 Shown],
If([Part 2 Completed] or not [Part 2 Shown] ,
If([Part 3 Completed],
"Finish",
"Part 3"
),
"Part 2"
),
"Part 1"
),
"Start"
)
Then you would need to create a formula-checkbox field [Part 2 Shown] that evaluates to true when you want that tab to be visible. I often do this to avoid having to create complex show-hide rules within a form. On the form, I put a section that is shown only if the user is an Admin, and add the [Part 2 Shown] field in that section. Finally, the form rule is then very simple: When [Part 2 Shown] is checked, show tab "Part 2". (Disclaimer: I have not actually tried this option, though I am pretty sure it would work.)
2) Somewhat more powerful (but also less transparent!) is a second option, which involves a modification of the script "saveAndNextTab.js". Essentially, the revised script, instead of finding the next tab, finds the next one that is not hidden. Here's the modified script; notice the first line. (Also, as a bonus, I've added a fourth line that scrolls to a place where that tabs will be near the top of the page, which is handy if you have fixed fields above the tab-ribbon and a lot of fields under the selected tab.)
var nextTabLink=$("li.ui-tabs-selected").next("[style!='display:none']").children("a");
$("#saveAndKeepWorkingMenuOption").click();
$(nextTabLink).click();
location.assign("#mainBodyDiv");
AlexWilkinson
7 years agoQrew Assistant Captain
#2 is wrong. See below ...