dbTalk Databases Forums  

Fields to Refrence Current Portal

comp.databases.filemaker comp.databases.filemaker


Discuss Fields to Refrence Current Portal in the comp.databases.filemaker forum.



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

Default Fields to Refrence Current Portal - 10-14-2006 , 04:23 PM






I am using FM 8.0 and wanted to know if there is a way to create a
field next to a portal which displays information from the selected
portal rows record; ie show notes pertaining to the information listed
in a portal row bellow the portal itself, when one selects a new portal
row the notes automatically change to show notes pertaining to that
record?


Reply With Quote
  #2  
Old   
Ursus
 
Posts: n/a

Default Re: Fields to Refrence Current Portal - 10-15-2006 , 05:20 AM






As allways there are mor ways to go. One may be the following

Create a global field gChoosenID the same format as your unique ID is which
use for the portal.
Inside your portal, on the upper row, create a button. Let it call a script
<MyScript>

<MyScript>
SetField ( gChoosenID ; MyFirstRelation::gChoosenID )
Refresh window ( Flush cached join results )

Create a second relation to the same table, using gChoosenID and the ID in
your second table, I call it MySecondRelation
Now put all the fields you need on your layout
( MySecondRelation::Field1
MySecondRelation::Field2 ) etc

When you now click on the button all info of the selected portal row should
appear. UNTESTED!

-
You could also use a calculation with a combination of GET
(CurrentPortalRow)
and GetNthRecord(fieldName;recordNumber)

Ursus


"vajra78" <vajra78 (AT) mac (DOT) com> schreef in bericht
news:1160861037.598120.72480 (AT) m73g2000cwd (DOT) googlegroups.com...
Quote:
I am using FM 8.0 and wanted to know if there is a way to create a
field next to a portal which displays information from the selected
portal rows record; ie show notes pertaining to the information listed
in a portal row bellow the portal itself, when one selects a new portal
row the notes automatically change to show notes pertaining to that
record?




Reply With Quote
  #3  
Old   
Bill
 
Posts: n/a

Default Re: Fields to Refrence Current Portal - 10-16-2006 , 06:46 AM



In article <1160861037.598120.72480 (AT) m73g2000cwd (DOT) googlegroups.com>,
"vajra78" <vajra78 (AT) mac (DOT) com> wrote:

Quote:
I am using FM 8.0 and wanted to know if there is a way to create a
field next to a portal which displays information from the selected
portal rows record; ie show notes pertaining to the information listed
in a portal row bellow the portal itself, when one selects a new portal
row the notes automatically change to show notes pertaining to that
record?
You can configure a portal to show as many fields from the related
record as you wish. A portal row can be made as deep as you like, with
fields and field names in any multi-row pattern you want within the one
portal row.

You can also put a pushbutton inside the portal row that will go to the
related record, with various options for displaying the related record.

--
For email, change <fake> to <earthlink>
Bill Collins


Reply With Quote
  #4  
Old   
vajra78
 
Posts: n/a

Default Re: Fields to Refrence Current Portal - 10-20-2006 , 01:30 PM




OK, first of all i can't show all the information from the record in
the portal, the portal becomes way to bulky.
I need to use a calulation so I can still enter data into the portal,
but I don't how to properly use the get function. Can anyone show how I
would enter the calcultion to get record info from the selected portal
record.


Reply With Quote
  #5  
Old   
Helpful Harry
 
Posts: n/a

Default Re: Fields to Refrence Current Portal - 10-20-2006 , 07:17 PM



In article <1161369000.141376.40430 (AT) k70g2000cwa (DOT) googlegroups.com>,
"vajra78" <vajra78 (AT) mac (DOT) com> wrote:

Quote:
OK, first of all i can't show all the information from the record in
the portal, the portal becomes way to bulky.
I need to use a calulation so I can still enter data into the portal,
but I don't how to properly use the get function. Can anyone show how I
would enter the calcultion to get record info from the selected portal
record.
I'm not sure how the Get Nth Record function works, but you don't need
it.

Theold fashioned way (which is more work, but will work in ANY version
of FileMaker that supports Relationships) would be to use some scripts
and buttons.

First, if you haven't already got them, create some Global fields that
will hold a copy of the data you want to display for the clicked
related record.
eg.
g_Address Global, Text
g_Description Global, Text

Then create a script that obtains the related data and stores a copy in
these Global fields.
eg.
Script: GetRelatedData

Set Field [g_Address, Relationship::Address]
Set Field [g_Description, Relationship:escription]

Next Draw a rectangle within the first portal row covering the whole
row - temporarily set it to say a green fill and line colour so that
you can see it, but later you can set it to no fill and no lines colour
so that it's "invisible". Set the rectangle to be a button that
performs the GetRelatedData script and then send it backwards so that
it's behind all the portal fields.

Now, if you did not want to edit the portal fields or use the portal to
create new related records, then you would be all finished. Clicking on
a portal row would cause the two Global fields to display a copy of the
data from THAT related record.

BUT, you DO want to still edit the portal fields.

To do this you'll need a few more scripts (technically in newer
versions of FileMaker you could use one script and pass it a variable
to say which field was clicked on, but let's keep it simple).

Create a new script FOR EACH field in the portal row that are something
like:
eg.
Script: Portal_FirstNameField

Perform Script [GetRelatedData]
Go To Field [Relationship::FirstName]

Click on the FirstName field in the portal row and set that to be a
button that performs script Portal_FirstNameField. Do the same for all
the fields in the portal row setting them to run their own scripts that
go to the appropriate fields after copying the data to the Globals.

All done! )

Clicking anywhere on a portal row will now copy THAT record's related
data to the Global fields, and if you click on a field in the portal
row it will copy the data and then leave the text cursor sitting in the
field for editing it. If the relationship is set to allow the creation
of new records, it will still work as well - the Global field will
simply be blank.


Notes:
A. The Global fields are simply for displaying a copy of the
related data - you can NOT actually edit the related data in
them. In fact, it's probably best to turn off the "allow
entry" option in the Field Format window for these fields to
stop people trying to use them for editing or performing Finds.

B. The GetRelatedData script above doesn't select the portal row
that you've clicked on. If you want it to do that, you'll need
to add a new Global field that stores the current portal row
number and then alter the script slightly to:

Script: GetRelatedData

Set Field [g_CurrentPortalRow, Get(CurrentPortalRow)]
Set Field [g_Address, Relationship::Address]
Set Field [g_Description, Relationship:escription]
Go To Portal Row [Select, By Field(g_CurrentPortalRow)]









Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)


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.