Jump to content
Server Maintenance This Week. ×

Can't Go to Related Record with new window


raymanj

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

Recommended Posts

I am trying to to view a related record in a new window, but I can't seem to get it to work.

Concept of what I am trying to do:

I have a file that have two tables, 'Customer' and 'Address'. I have a layout in form view that is based on the customer table. There is a portal on this layout that is related to the address table. I want to be able to click on one of those addresses listed and for that address to open up in a new window filled with the address I clicked.

What is currently happening:

I click the portal row and the new window appears but not the correct the address I clicked. I either get a blank record or the first record in the portal list.

Script Steps:

Freeze Window

New Window

Go to Related Record [show only related records, From table "Address", Using layout "Edit_Address" ]

Could someone let me know what I am doing wrong here and what are the basic rules to going to a related record from a portal into another window. Regarding relations, layouts and what script step order to accomplish it.

Thanks

Link to comment
Share on other sites

Once you open a new window, you're no longer in the portal, so the first related record will display since it's the 'default' for related records. Flip your New Window and GTRR steps, or specify the GTRR to open in a new window.

Link to comment
Share on other sites

Well, using the all in one "go to related record" script step worked. I just thought it could be done with multiple script steps. I can see this may become a problem in the future if I need to break down the components of the for a conditional window construction. I would have to create a bunch of similar go to related record steps but with different window characteristics. This could be a pain.

Anyone know of a way to accomplish this without the all in one go to related record step?

Link to comment
Share on other sites

Like I said, you can GTRR and then use New Window; but you can't New Window and then GTRR to view the correct record.

I tried this and it did not give the results I was looking for but it did show the correct related record in the new window. The side effect was the parent window (the window with the portal that was clicked) also changed to the related record and layout.

I guess the only way is to use the all in one GTRR script step.

Another question. What if I have two windows that are always open, displayed, The parent window is a form with a portal the a related table and the second window is form that shows that related table into? I click a portal row and that portal record should appear in the second window but with more data fields displayed.

In the GTRR script step doesn't to allow to select another current window open and then display the related record, but only create new windows.

Does anyone have any comments on this:

Link to comment
Share on other sites

in response to your original question, if you are still not getting your desired results:

Assuming you have an AddressID per address, in address have a global field g_SelectedAddressID. Create a self join relationship between AddressID and g_SelectedAddressID. For this example, it's well call the table occurence (relationship) Address.Selected

in your script that runs from clicking the portal:

set field [Address::g_SelectedAddressID, Address::AddressID]

New Window

GTTR [only related, Table "Address.Selected", Layout "Edit_Address"]

I am doing something very similar. this is off the top of my head, but it should work just fine.

HTH

Link to comment
Share on other sites

  • 9 months later...

I'm doing something along these lines but am having trouble.

I have client and invoice database. In the client file I have layout where they can view a list of their invoices in a portal.

In each portal I have a button that says View Invoice which goes to that invoice, no problem. Another button says view Notes which I want to bring up a window with the notes on that invoice. It brings up the window but always goes to the first record, not the portal row record. The script for the notes button is:

Commit Records

Allow user abort off

Freeze window

GTRR from invoice using notes new window

pause script indefinately

close window

Any help?

r

Link to comment
Share on other sites

This new wrinkile in intrinsic to the Version 3 Patch from FM7.

Filemaker 7v03 Fix List says:

1.4.1. In order to be consistent with other script steps and with previous versions of FileMaker Pro, the Go to Related Record script step no longer brings the related window to the front automatically, except when used from a button. In order to bring the related window to the front, you must add a Select Window step to the script.

Question - To anyone's knowledge does opening all of these multiple windows reduce performance at all or use up extra cache?

Link to comment
Share on other sites

Hi Ron,

It's not saying you have to create a new window, it's saying you need to use the Select Window[] script step in order to change focus after the Go to Related Records[] step.

Link to comment
Share on other sites

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