Tab Panel Script Trigger Issue

Based on a prior EE answer, I revised a script in order to execute a calc when I entered the Tab "LeadCounter" from the "MainData" tab.  I gave each of these a name in the "Name field" in FM 11's Inspector and then attached it to the script, but it doesn't work.  What am I doing wrong?  See attached.

Also in the attached are screen prints showing I searched EE (why isn't my previous question about using script triggers with tab panels there?) and that I searched FM Help.  Thanks.
TabControlIssue.doc
LVL 2
rvfowler2Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jvaldesCommented:
I do not understand what you are trying to do. If you need to trigger a script by entering a tab then use the script rigger OnObjectModify that is within each tab. If you need to have a calculation made when you select a tab, there is a little known trick that any calculation on the face of the tab will be done upon selection of the tab, including when the default tab is initially selected. The calculation should be made with a Let function.

Unfortunately when you change the font color to mask the calculation it will also be masked when you are in layout mode. I have a method I learned from FilemakerMagazine.com. But that is a different question.

Lastly to go to a specific tab or object use the go to Object command in the script editor.

Please be more specific see if I can help you.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rvfowler2Author Commented:
Yes, I wasn't clear, mixing two issues.  First, I want to prevent the tab "bounce," meaning when you select a Tab trigger to OnObjectModify, when you leave the tab, it also sets off the trigger, and I don't want that.  See the attached.  I tried to take care of the "bounce," but this scripting did not work.  How would you do it?

Second, I want a calculation to be set off once I enter a tab, but you answered that question.  Turns out my test of that didn't work for another reason, but fixed that.  Thank you.
TabBounceTest.doc
0
jvaldesCommented:
To eliminate the bounce, use the script trigger to set a variable like $CurrentObject, not to execute a script. That way you can choose when you fire the script.

Tell me if this helps
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

rvfowler2Author Commented:
But I want to do both:  I want to prevent the bounce, but I also want to set off a trigger.  Notice in the earlier Word doc that I had successfully done it for an Admin Only tab so non-Admins could not enter the area and were sent back to the MainData tab.  However, I can't seem to make it work here.
0
jvaldesCommented:
Fire the script from a different trigger, for example if you keep $CurrentObject, you can decide if the abject is the same as the prior Obect and not fire...
0
rvfowler2Author Commented:
I just tested it and it confirmed my memory that the only script trigger that works with Tab Panels is OnObjectModify.  The other issue is that for some reason that scripts I've attached above don't take care of the bounce.  Not sure why.  I'm new at this.
0
jvaldesCommented:
Post an example of the problem and I will help you resolve it. I don't think I was clear, if the first step in your script that you trigger with OnObjectModify you check to see if $CurrentObject is different than the current object and only trigger if different it will not fire if you don't change the object in the same tab object.
0
rvfowler2Author Commented:
Yes, I never did understand why the attached AdminOnly script worked.  I just tested it in another dbase and it works!  But, it does not work here.  Now I'm really confused, so let me write this out.  First
set $tab = GetActiveLayoutObjectName
If GetActiveLayoutObjectName = AdminOnly
then
go back to old tab (but how do you script this?)

Forget it, I'm completely confused.  I know this is easy, but I just can't get it.  I have to get back to work.  I just spend a half hour on this.
Adminonly.doc
0
lesouefCommented:
goto object ([tab name]) to swicth tabs.
have a look at my example I did a few weeks ago, it was taking care of the bounce problem as well. I have not got the file here, but I may locate it too-morrow on my other PC. Have you placed a trigger object on each tab?
0
rvfowler2Author Commented:
I'm not sure what example you mean.  I've searched EE and didn't find it, even the one I asked about 3 months ago.  Not sure what you mean about a trigger object on "each" tab as once I place a tigger on one tab, it seems to show up on all tabs.
0
lesouefCommented:
I remember I did it after an explanation of jvaldes, maybe I did it for me only, and did not send it? can't remember now.
well, the file is on my portable I think, not even sure, maybe on my PC @ home (won't be there before next saturday). I'll have a look tonight on my portable and see if I have it with me.
0
lesouefCommented:
internet connection down at the hotel, could not connect to check the file. will try again tonight.
0
rvfowler2Author Commented:
OK
0
rvfowler2Author Commented:
First, tried your method and it didn't work for me.  I edited out the message box and maybe I affected it.  See attached.  Also, figured out why my prior code worked in one database and not another.  Whoever gave me the code also had me put code into the conditonal formatting for a text box (also shown in the attached) that was on the AdminOnly tab panel.  Very strange way of doing it, but it works.  However, I think I'd rather use yours if I can get it to work.
TabControlIssue.doc
0
lesouefCommented:
you are confusing the tab label which does not matter and the tab object name which the one to use for switching tabs. you doc does not show the tabs object names.
and yes, you need this conditionnal format on all tabs to find out the current tab, and set the old one to go back to it whenever needed
0
rvfowler2Author Commented:
Actually, I am aware of the difference between tab labels and the object names.  Notice that my labels have a space between them and the object names do not.  Looks like you confirmed that what I forgot was to add text and add the conditonal formatting script to it.  Thanks.  Awarding points.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
FileMaker Pro

From novice to tech pro — start learning today.