dbTalk Databases Forums  

Go to a related record in an existing window

comp.databases.filemaker comp.databases.filemaker


Discuss Go to a related record in an existing window in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jon Sherry
 
Posts: n/a

Default Go to a related record in an existing window - 07-13-2005 , 08:05 PM






Hi all,
I'm building a database where data entry is performed in a separate window
for each table.

If a the window for a related table is already open, I want to re-use that
that window to display the related record, retaining any re-sizing and
re-positioning.

I'm going to a related record from a portal row. I tried the following
script:

If[ PatternCount (WindowNames; "Assign Assets To Location")>0]
Select Window ["Assign Assets To Location"]
Go to Related Record [From table: "Locations"; Using Layout: "Locations"
(Locations)]
Exit Script
End If

Go to Related Record [From table: "Locations"; Using Layout: "Locations"
(Locations); New Window]
Adjust Window [Resize to Fit]

This works to open a new window with the related record. If the window is
already open, it activates the window, but merely displays the same record
as before the script is run.

Is there a way to do this without a procedural script (cut/paste/find)?
Using the relationship is much cleaner.

I could get the size and position of the target window, close and re-open
it, but will Filemaker remember which portal row the button click was from?

Yes, that works:

If [ PatternCount (WindowNames; "Assign Assets To Location")>0 ]
Select Window [ Name: "Assign Assets To Location" ]
Set Field [ Globals::gWindowHeight; Get ( WindowHeight ) ]
Set Field [ Globals::gWindowWidth; Get ( WindowWidth ) ]
Set Field [ Globals::gWindowHPos; Get ( WindowLeft ) ]
Set Field [ Globals::gWindowVPos; Get ( WindowTop ) ]
Close Window [ Name: "Assign Assets To Location" ]
Go to Related Record [ From table: "Locations"; Using layout:
"Locations" (Locations) ] [ New window ]
Exit Script
End If

Go to Related Record [From table: "Locations"; Using Layout: "Locations"
(Locations); New Window]
Adjust Window [Resize to Fit]


Better than a procedural script, but I'd still prefer the first option if
there's a way.

Thanks for any suggestions,
-jb


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.