Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Juggernaut

Go to Portal Row when more than one instance of portal exists on a layout

Featured Replies

On a layout I have a portal displaying related records. There are several fields in the portal which means that I can only display so many records - no problem I just have multiple portals for the same relationship using the "Initial row", "Number of rows" parameters to have side by side portals display the data.

My problem is jumping to specific portal rows in the multiple instances of the same portal. Let's suppose PortalA contains records 1-20 and PortalB contains 21-40. If the focus is in portalB and you run a script to go to portal row the dialogue shows "Go to Record X out of 40 and if you make x = anywhere between 21 and 40 you do indeed go to that portal row.

However, if you make x = say 5 (in PortalA) then it won't jump into that portal row.

Interestingly, if the focus is in portalA and you run a script to go to portal row the dialogue shows "Go to Record X out of 20 even though there are 40 portal rows across the 2 portals!

I think this is a Filemaker bug. I had thought of giving each instance of the portal a different object name but I can't figure out a way of capturing the object name of the portal that a particular record is displayed in.

Can anybody help?

There are several fields in the portal which means that I can only display so many records

I presume that scrolling the portal is not an option?

Phil

  • Author

No, for various reasons I need to display all the data at once, not have some hidden in a scrolling portal.

OK then

I have not done this before so this is a stab in the dark but.... how about creating 3 (empty) globals in the related table. Place each one in one of the portals. Issuing a go to script step naming the relevant global I think will put you into the first row of the portal that you want to be in and then it is up to you how you get to the required row.

Forgive me if this doesn't work I am just thinking out loud

Phil

  • Author

sounds possible -will give it a try.

thanks

  • Author

OK tried the global field in portal idea (g_portal) - thought I may be able to trap the error when you try to go to a portal row not in current portal then script to go to next g_portal field etc until the row is found. Snag is, there is no error to trap! With error capture on the dialogues still appear and get(LastError) doesn't return anything!

First of all did the goto step take you to the portal that you wanted?

And if so why would you ever try to go to a portal row that doesn't exist in the portal?

How or who is determining which portal row that you want to go to?

Phil

  • Author

I've attached an .fp7 file to show you what I'm trying to do. The data in my portals is much more complex -hence the size of the portal. Basically imagine it like a flow diagram - one record is linked to another via the order/jump values. Try the "picker" and you will see what I mean about being able to jump to first portal but no any other.

thanks for thinking about this, Ian

portaltest.zip

OK Ian

I have had a look at your file but I am still a little unclear so if you could bear with me while I gather a little info as to what you are trying to achieve.

When you (successfully) go to a portal row what do you want to do once you get there?

You seem to be definite that you need all the related records displayed. At the moment there are 32 rows on view.

Are you sure that there are never more than 32 rows and are there occasions when there are less than 32 rows available?

Lastly, since all the available rows, no matter how many/few there are, are on display, why not just click into the portal row that you want and run your script from there?

phil

  • Author

OK

in my real there are many fields to display so a single portal can only display 40 rows - to the bottom of the layout screen. Yes I do need to see all the records in the file but given that there will be several portals across I need to jump to the right record on the layout - hence the "picker". The number of records will vary but I can predict a maximum so set up enough portal space for this (there will be multiple instances of this database to author multiple flow diagrams sourcing data from related tables) Also as a flow develops, the portals will be shifted around in layout mode in order to make the work.

to aid navigation around a flow I want my authors to be able to jump from one portal to another or use the picker - if I can get the picker working I can get the jumps form one recor to another in a different portal to work as well.

Sorry Ian I am going to have to invite someone else to jump in here to help you because I am a bit out of my depth. Any Takers ??

Good Luck

Phil

  • Author

thanks for trying

Ian

The thread has evolved considerably since I set out to make a template, but here's how I would accomplish it.

--sd

Jumpingbeans.zip

  • Author

Many thanks Soren - this looks as though it will do the job.

I've experimented a little and can see how some of it is done - I have added a fourth portal but I don't really understand all the steps in your script. Any chance of you adding some comments to it?

Thanks, Ian

I am not too sure what's required here either, but here's another idea.

portaltest.fp7.zip

Indeed I can - the key to it all is the new Object features. What I have done is naming the field pulled into each of the visible portal, something different.

But lets take the script right from the start.

1) We need to be sure that the desired portalrow exceede what's availiable.

2) Removes the cursor from being parked in a field.

3) Here do I select the object to go to, the function Div( returns the next lowest integer value after dividing

4) The rest from the division gets us number to the correct row in the selected portal.

5) Which is used by the looping to end in the portalrow.

6) Since the Go To Next Field just jumps into the field without selecting the enire content do we at last select every char from 1 to 9999 in the field.

So what you need is to make a field in the new portal an object as well. Then do you need to adjust the Choose( found in third line of the script by adding the word you have chosen in quotes following the word "third" ....

--sd

Billede_1.jpg

Edited by Guest

  • Author

Hi Soren,

think I've got it worked out now - don't worry about adding comments. this has given me a real start on solving problem, many thanks.

  • Author

Sorry - our posts crossed - thanks for notes

  • Author

OK, I've got the hang of it but have one more complexity which upsets line 3 of script. That is not all portals will have same number of records!

Div function does not work with some portals having more than 4 records.

Any ideas?

No the 4 is the number of rows in each, if your portal have 6 rows change the number accordingly. So sime sort of splits aree needed to change the base, and the overflow....

--sd

  • Author

What I mean is some portals may have 5 records, some 6 some 10 etc. If they were all the same then your solution works fine - as you say by altering the div value.

I'll get you a solution tomorrow, a Case( statement should steer the the Choose( statement as well as the carry overs.

--sd

  • Author

Many thanks Soren - will get to work adapting this and let you know how I get on.

  • Author

OK Soren, with your help i've cracked the problem. Your script works great when the portal row only conatins one field - in fact I think it can be simplified - see my adaptation in attachment.

For my portal, with multiple fields I have found a different solution - see pickerscript.jpg

I doubt if I would have got there without your ideas so many thanks.

Ian

picker_script.jpg

Jumpingbeans3.zip

Not that I've keept myself on the straight and narrow, simply because it doesn't exist here except for some attempts to conventions ... but you have to consider "saying names"

http://en.wikipedia.org/wiki/Identifier_naming_convention

With filemaker in focus, should you consider the reasoning made here!

http://www.sumware.net/robfm/conventionalnaming.php

--sd

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.