Jump to content

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


IanPDT

This topic is 6354 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This topic is 6354 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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