Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

Hi,

I think this will have already been discussed, but I have not been able to find the thread. Happy to read another similar solution to fix my problem. Thanks for any pointers to previous discussions.

I have three tables: client, computer, filepath. They are one to many links:

One client can have many computers and one computer can have many file paths. I am trying to setup a layout that looks like this

CLIENT INFO BLOCK

[PORTAL1: fields from COMPUTER, records filtered to show only related to current company]

[[PORTAL2: fields from FILEPATH, records filtered to show only related to currently select COMPUTER in PORTAL1]]

Seems simple. So far my PORTAL2 shows ALL the records associated with the current COMPANY not the currently selected COMPUTER in PORTAL1.

I have tried a simple relationship diagram/relationships at this point:

Relationship1: COMPANYR:KeyID = COMPUTER:CompanyID

Relationship2: COMPUTER:KeyID = FILEPATH:ComputerID

I tried a couple of other things with global fields (second instance of FILEPATH, additional relationship and basing PORTAL2 on that), but I am doing that wrong, or it is not the right answer as I had worse results, too hard to explain, even if I could.

There must be a simple solution to this that I have not found yet.

Thanks, I hope my desired outcome is clear . . . not sure i have made it so.

bob

Posted

Perfect -- I was close, the examples showed the error of my ways. Many thanks!

Now, I am trying to put buttons OUTSIDE the portal. The buttons calls a script with does a next (or prev) portal row, followed by setting the global field that drives the relationship. If the most recently selected portal is PORTAL2, the script, rightfully, works on PORTAL2. What is the bets way to "select" PORTAL1 as the first script step? I can GOTO a field in the portal, but that does not seem right somehow.

Thanks,

Bob

Posted

Well, let's see. I followed the link you provided above. The reply to that poster's question was to use a global field. Then you posted in that thread a link to another thread, and referred to variables/filtered portals. Then the next post included and attached file that demo's the global field route, I tried it and it works. I stopped researching once the first example provided worked. I will go review the thread the next hop away, I did not understand that was where you wee directing me. Will it solve my problem of selecting the correct portal as the first script step??

Thanks,

bob

Posted

Will it solve my problem of selecting the correct portal as the first script step??

I don't think so. I also don't think that is your problem - but perhaps I am misunderstanding what you want to accomplish.

Posted

Sorry if I was not clear in what I am trying to do.

I have two portals on one layout. I also have a button that is on the layout, but not "within" either portal.

I would like clicking the button to run a script. No problem there.

I would like the script to advance the "current" record in a particular portal (call it PORTAL1) to the next record in PORTAL1. Everything currently works as long as when the click event happens, PORTAL1 is the most recently "selected" portal.

If PORTAL2 is the most recently selected portal, then the current record is advanced in that portal; it makes sense to me why that is happening. I was/am looking for the most efficient way of having the script advance the record specifically in PORTAL1. Thinking it through, I don't care if PORTAL1 is selected after the script is completed.

Currently my script is using the "Goto Portal Row: Next" step.

Thanks for any advice on this.

Bob

Posted

I would like the script to advance the "current" record in a particular portal (call it PORTAL1) to the next record in PORTAL1. Everything currently works as long as when the click event happens, PORTAL1 is the most recently "selected" portal.

I am not sure how it works for you.

Selecting the right portal is very easy: if no portal is active, Go to Portal Row[] will select the portal furthest to the back in layout's stack order. Or, you can name the portal and use Go to Object[] to select it, before going to a row.

However, both Barbara's demo and mine store the selected child's record ID - NOT it's position in the portal. Once you have selected the child, the portal becomes irrelevant. The "next child" is indeed in the row below the most recently clicked one - but the most recently clicked row number is not being remembered.

Posted

Thanks, I think I will be able to accomplish what I need with the Goto to Object, not sure how I missed that before.

As for the other comments, I am either missing a big part of the solution (which I don't think is the case), or you are over thinking what I am trying to do. I simply need a button that will advance to the next row in the child portal. ie change the "current" record from row1 to row2 in the "child" portal. When that is done, I want the grandchildren records to show for the then "current" row in children.

I have now reviewed and setup both the global field and variable/filtered portal methods, and am testing both. I am curious about the memory implications if there are thousands and/or tens of thousands of records involved. Is there a way to release global variables, or have them time out after a some period? Timeout would seem to defeat the purpose, so I imaging that is not an option. But if someone is in FMP for hours, and browsing many records, what is the best way to handle the "accumulation" of all these variables. Maybe I missed it, but I did not see any place where they are cleared? I saw questions but o clear answers about this in the threads you directed me to.

Thanks,

Bob

Posted

I am either missing a big part of the solution (which I don't think is the case), or you are over thinking what I am trying to do. I simply need a button that will advance to the next row in the child portal. ie change the "current" record from row1 to row2 in the "child" portal. When that is done, I want the grandchildren records to show for the then "current" row in children.

I think I am missing the part where [a] you select the child record in portal row #3, do anything that will deactivate the portal (for example, scroll the grandchildren portal or just click anywhere outside the portal) and [c] click a button to go to the next portal row, which would be row #4 - IF the number 3 were stored somewhere. Since it's not, and the portal row is no longer active, I believe the Go to Portal Row [Next] step will simply go to the first row. But you say it works for you - so I'd be curious to see how you managed to do this.

Re the variables: I don't know how many records a user can view (in detail, including a selection of a child) during a session. If that worries you, you can clear the variables - the only question is when.

Posted

You are right, it does not work as I had hoped -- As long as the portal retains focus, it works fine. When it looses focus, and regains it, it reverts to row one. I think I will need to revise the original layout plan to make it user friendly and functional, and not worry about memory use. Though I guess I question that, thinking maybe FMP is smarter than me (not much question there), and the memory is a non-issue, or folks here would know about and report about it. Off to re-work the plan. Thanks for all the help. I am much closer now than before.

Bob

This topic is 4969 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.