qube99 Posted November 16, 2008 Share Posted November 16, 2008 I have multiple portals in a single layout. The script step "Go To Portal Row [Last]" doesn't work. It seems like the script doesn't know which portal to target, so it just targets the first one it comes to. Is there a way to get that script step to act on the correct portal in FMP Advanced 8? Link to comment Share on other sites More sharing options...
IdealData Posted November 16, 2008 Share Posted November 16, 2008 Do a Go To Field first selecting a field that is in the desired portal. This will give some "focus" for the Go To Portal row step. Link to comment Share on other sites More sharing options...
qube99 Posted November 16, 2008 Author Share Posted November 16, 2008 I've tried Set Field and Go To Field both. These work alone. But then it jumps to the wrong portal when I try to select the last portal row. Go To Field [Time::pk_timesheet] Go To Portal Row [Last] This jumps to the portal for Expenses because it appears in the layout before the portal for Time does. When I take it out it selects the first portal row in the correct portal, Time. I've even tried adding a second Go To Field, but that has no effect. It still jumps to a different portal when the script executes the Go To Portal Row command. Geez. Link to comment Share on other sites More sharing options...
qube99 Posted November 18, 2008 Author Share Posted November 18, 2008 I found the solution so I thought I'd post it. The field targeted in the Go To Field script step above is the serial number (primary key) from the Time table. This field must also be located in the portal on the Jobs layout for the script step to work properly. To hide this serial number in the portal I made the font 1pt, set the color to match the background and layered it underneath. In my case the Time table is an external table. I don't know if this problem would occur with internal tables. The script above now works properly. Link to comment Share on other sites More sharing options...
bcooney Posted November 18, 2008 Share Posted November 18, 2008 This sounds odd, Steve. What is the table occurrence name that the layout is based on (Layout Setup)? What is the table occurrence name of the portal that you wish to select (dclick on portal to view), and what is a field name that is in the portal? Link to comment Share on other sites More sharing options...
qube99 Posted November 19, 2008 Author Share Posted November 19, 2008 (edited) The main table/layout is Jobs. It is a standalone database with no internal tables. The Jobs layout has multiple portals, Expenses and Time for example. Both of these are external standalone databases. All portals are linked with a many to many relationship based on two primary keys. In the Jobs layout each portal is linked via the primary key but shows data from another field, Job Number. The Go To Field script step needs to be targeted to the primary key. This works fine and dandy when there's only 1 portal in Jobs. When there are two or more portals in Jobs the primary key field must now be included in each portal, even though you don't want it to display. Without the primary key field being present in the portal, the Go To Field script step can't tell which portal to target. None of my manuals or training DVDs gives this requirement. While it makes sense, it's not always obvious that the field is required in a multi-portal layout and not required in a single portal layout. Edited November 19, 2008 by Guest Link to comment Share on other sites More sharing options...
bcooney Posted November 19, 2008 Share Posted November 19, 2008 The main table/layout is Jobs. It is a standalone database with no internal tables. Huh? Do you mean..The Job layout is based on the JOB table occurrence. This is in the JOBs file, which is a single table file, JOBs. The Jobs layout has multiple portals, Expenses and Time for example. Both of these are external standalone databases. Both of these are related Filemaker files, each with one table? I assume that Expenses and Time are related to Job by JobID? All portals are linked with a many to many relationship based on two primary keys. A cartesian join? Therefore the Expenses and Timesheets portals... (which really should be in one table if you're trying to sum costs)...are not related to the Job that you are viewing? In the Jobs layout each portal is linked via the primary key but shows data from another field, Job Number. Now you say the portals are linked via a primary key, and by that you mean related by a primary to foreign key relationship. Huh? The Go To Field script step needs to be targeted to the primary key. It needs to Go to a Field that is in the portal, yes, but not necessarily a primary key. Link to comment Share on other sites More sharing options...
qube99 Posted November 20, 2008 Author Share Posted November 20, 2008 Huh? Do you mean..The Job layout is based on the JOB table occurrence. This is in the JOBs file, which is a single table file, JOBs. Yes, Jobs is a standalone table. Both of these are related Filemaker files, each with one table? I assume that Expenses and Time are related to Job by JobID? Yes, all are individual databases related by primary-foreign keys. Now you say the portals are linked via a primary key, and by that you mean related by a primary to foreign key relationship. Huh? Yes. Time is related to Jobs by a primary-foreign key. Expenses is also related to Jobs by another primary-foreign key. I use a many to many relationship so that some data from Jobs is auto-entered in Time and Expenses when a new record is created. It needs to Go to a Field that is in the portal, yes, but not necessarily a primary key. This is a bit odd in my solution. I tried different fields in the script step and didn't get the results I wanted. It seems that the Time primary key field is required in the Time portal for everything to work correctly. Same for the Expenses portal. I don't know if different solutions would have different limitations and requirements. I only encountered this in a multi-portal layout using external databases in FMP 8. I think that you might not have this problem in FMP 9 where you can name and target Objects, including portals. Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 5777 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now