From Dwayne Wright PMP
Certified FileMaker Developer
Please Note: If you are viewing this page in a news feeder, the images may get munged up a bit or other formatting of the posting may fail. For the best experience, please visit the journal directly by clicking (here)
A person sent me an email about their troubles scripting portals. They wanted a script to have one portal to pass information to another portal in the same layout. Many times, the script would go to the wrong portal for any of the scripted actions. They commented that ScriptMaker does not allow you to choose which portal you want to have the script step to act upon.
As you can see from the figure above, your only choices regarding the portal script step are which portal row and select entire comments (yes/no). It is like FileMaker Inc. never expected users to have multiple portals on the same layout.
There are a number of occasions where you may have more than one portal on a layout. Since you cannot choose which portal you want to go to, are you lost?
Your first option should be to make the portal active that you want. To make a portal active, you simple need to go to a field or a named object within it. So you will want to use the Go To Field or the Go To Object script step first, to go to one of the fields/objects in the portal. This will activate the correct portal for you to follow up using the Go To Portal Row script step. Going to a field or object first in your script is the traditional fix for this task and it is quite easy to do.
GO TO OBJECT SCRIPT STEP
Well, FileMaker developers have been waiting a long time for this script step to appear and when it did, they took advantage of it. In FileMaker 9 and later, you can identify a layout object with a name via the object info dialog box. This script step will take the user to that object, be it a field, a button, a tab pane, the web viewer and more!
You do need to make sure that all your objects are unique. You do have the script parameters to specify the object you want to go to (and this can be a calculated value, how cool!) and what repetition of the object you want to go to.
More info about the author and FileMaker in general, contact me at email@example.com.
© 2008 - Dwayne Wright - dwaynewright.com
The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.