Hi John,

Having the portal record's foreign key = the primary key of the current record has always worked for me when it comes to highlighting / conditional formatting. In Richard's case it is the same concept only that it is a self relationship based on category. Therefore pointing the primary key of the portal record to the primary key of the current record works.

        -Charlie

On Nov 4, 2009, at 2:43 PM, John Weinshel wrote:

There's not really any passive way for a child record to know it's also a parent. Filemaker is fairly event driven; you'll need some kind of event to
tell that child the news.

If you're using Filemaker 10, then that event can be loading a record, which would drive a script trigger. The script would set a global to the value of the current record's ID. The conditional formatting in the portal row would be revealed if the ID of the record in the portal row were the same as the
global.

In other words, the formula for the conditional formatting would be:

Record_ID = Global_ID

The script triggered by OnRecordLoad would be:

Set Field["Global_ID"; "Record_ID"]

OnRecordLoad is a layout trigger; it will be called each time you 'page
back' to a different record.

If you are using an earlier version, you'll need to script navigation
between records, and then add the same script step to the nav script.


John Weinshel
Datagrace
Vashon Island, WA
(206) 463-1634
Member, FileMaker Business Alliance
Certified For FileMaker 10


-----Original Message-----
From: FileMaker Pro Discussions [mailto:FMPRO- [email protected]] On
Behalf Of Charlie Abrams
Sent: Wednesday, November 04, 2009 11:11 AM
To: [email protected]
Subject: Re: Identifying the Current Record

Highlight the portal record fields in layout mode. Select Format Menu/
Conditional.  Under the condition, select Formula.  In the calculation
dialog, have your "'framistans'"  ID = to the parent record key.  In
other words, if the parent key for the framisans record is equal to
the parent key of the current record, then do something.

Charlie
Bonding Solutions, Inc.


On Nov 4, 2009, at 1:51 PM, Richard S. Russell wrote:

Here's a little problem I'm encountering, and I can't figure out a
way around it. Probably I'm just overlooking something obvious.

My problem is that every record thinks that IT is the current record
- or at least it behaves that way - and there seems to be no easy
way to check to find out if it really IS the current record.

To help make this problem statement easier to understand, I'm going
to introduce a new term: "This Record". Let me illustrate what I
mean. Here's a very brief set of records from the "Widget" database:

ID      SKU     Price   x       Qty     =       Cost
11      AAA     $0.99   x       100     =       $99
22      BBB     $2.80   x       200     =       $560
33      CCC     $0.42   x       300     =       $126
44      DDD     $5.00   x       400     =       $2000

So the AAA record "thinks" that the "This Record" value for Price is
$0.99, the BBB record "thinks" that the "This Record" value for Qty
is 200, the CCC record "thinks" that the "This Record" value for
Cost is $126, and (importantly) the DDD record "thinks" that the
"This Record" value for ID is 44.

Now suppose you click on CCC to make it the current record. As you
would expect, it "thinks" that the "This Record" value for ID is 33.
It also "thinks" (accurately) that the "CURRENT Record" value for ID
is 33.

But what do AAA, BBB, and DDD "think" is the "CURRENT Record" value
for ID? Danged if I can figure out how to compute this and
communicate it to them.

Let me explain just briefly why I'm trying to figure this out. I've
got a database where the records are subsetted into categories. The
specifics don't matter. Let's say the database tracks "Widgets" and
some of the values in the "Category" field are "doohickeys",
"whatchamacallits", "thingamabobs", and "deelybobbers". I call up a
record for a Gold-Plated Framistan Type 2, which falls into the
category "framistans". A link of "Category" to itself enables me to
display a portal showing ALL the framistans in the file, one of
which is, of course, the Gold-Plated Framistan Type 2 that we're
currently looking at.

What I want to do is display a yellow highlight behind the line in
the "framistans" portal on which the Gold-Plated Framistan Type 2
appears. If I then page back to the previous record, for the
Platinum-Plated Framistan Type 1, I want THAT record to be
highlighted in the portal.

How to do this?


Reply via email to