Hi Richard,
It sounds like you need a list of your key field to create the
relationship you want. In you 'Context Socket' calculation try
GetnthRecord(myKeyField, Get ( RecordNumber ) - 9) & "¶" &
GetnthRecord(myKeyField, Get ( RecordNumber ) - 8) & "¶" &
. . .(you get the idea) . . . & "¶" &
GetnthRecord(myKeyField, Get ( RecordNumber ) + 9)
Where myKeyField is an indexed field that you can use for a
relationship. Your relationship will be Context Socket = myKeyField.
getnthrecord idea for choosing your highlight criteria, and you should
get what you want. Try ContextualPortal::ID =
GetNthRecord(MainFile::__ID;Get ( RecordNumber )) assuming you are on
the the main record, or put the ID value in a global field or global
variable and compare to that.
I'm sure someone will give you an elegant solution, but this should do.
Mike
On 21/01/11 6:13 PM, Richard S. Russell wrote:
*Problem Part the 1st:*
I would like to present a user with a context portal which contains 19
lines. The center line (#10) will be occupied by the current record,
the 1st 9 lines would be occupied by the 9 records which *precede* the
current record in the current found set, and the last 9 lines would be
occupied by the 9 records which *follow* the current record in the
current found set.
It seems to me that this could best be accomplished by having a
calculation called "Context Plug" (= "Get ( RecordNumber )") and
pointing it at another calculation called "Context Socket", calculated
thus:
Get ( RecordNumber ) - 9 & "¶" &
Get ( RecordNumber ) - 8 & "¶" &
Get ( RecordNumber ) - 7 & "¶" &
Get ( RecordNumber ) - 6 & "¶" &
Get ( RecordNumber ) - 5 & "¶" &
Get ( RecordNumber ) - 4 & "¶" &
Get ( RecordNumber ) - 3 & "¶" &
Get ( RecordNumber ) - 2 & "¶" &
Get ( RecordNumber ) - 1 & "¶" &
Get ( RecordNumber ) - 0 & "¶" &
Get ( RecordNumber ) + 1 & "¶" &
Get ( RecordNumber ) + 2 & "¶" &
Get ( RecordNumber ) + 3 & "¶" &
Get ( RecordNumber ) + 4 & "¶" &
Get ( RecordNumber ) + 5 & "¶" &
Get ( RecordNumber ) + 6 & "¶" &
Get ( RecordNumber ) + 7 & "¶" &
Get ( RecordNumber ) + 8 & "¶" &
Get ( RecordNumber ) + 9
The problem is that I can't require either of these calculation fields
to be stored (or they freeze at some point in time, rather than
shifting dynamically based on Find conditions and sort order), but I
can't establish a relationship between them if they're not. Am I
missing anything obvious here?
*Problem Part the 2nd:*
Assuming I'm looking at a record which contains a portal showing
similar records, I would like the portal line featuring the record I'm
currently looking at (known to FMP documentation as the "current
record") to be highlighted. Unfortunately, it appears that every
record thinks of ITSELF as the current record, whether it is or not at
any particular time, and I'm unable to make the actual current record
stand out in a crowd. (This points up the ambiguity in FMI's use of
the term "current record".)
Once again, does anyone have any tricks to make this happen?