Newbies Inforoots Posted June 24, 2004 Newbies Posted June 24, 2004 I guess my question is related to the precedent message, but here I go: Is it possible to make (via a calculation field) a list of related portal rows for a given record ? I tried : "First item : " & RelationName::Field.0 & "Second item : " & RelationName::Field.1, etc but it is not accepted by FMP 6...
-Queue- Posted June 24, 2004 Posted June 24, 2004 Yes, but it will require creating a valuelist for each related field or a valuelist based on a related calculated that concatenates the desired fields, a global repeating number field with as many repetitions as possible related records, an auto-entered or calculated value of 1, a self-relationship from this '1' field to itself, a repeating indexed number field that looks up the global repeating field using this relationship, a trigger field based on modification time, a calculation that returns the current serial when a record is modified, a relationship from this calculation to the serial field, an indexed repeating calculation field that parses the valuelist(s) to pull the data for each line, a valuelist based on this field, and an unstored calculation of the ValueListItems( ) for that valuelist. You'll also need a script to set the serial field to itself to force a refresh. Trust me, it's much easier to go to the related records and run a script that loops through them and sets a related field (back to the parent file) with the current data.
Newbies Inforoots Posted June 28, 2004 Author Newbies Posted June 28, 2004 I had a good laugh reading your answer thank you That's sometimes the way things look in FM....but the solution is always simpler than what you thought The answer you gave to Kip sounds good too so i'll tell you when it works for me goodbye dom
Fitch Posted June 28, 2004 Posted June 28, 2004 It might not be as complex as Q made it sound. A simple script step: Set Field [ result, ValueListItems( Status (CurrentFileName), "yourRelatedRecords" ) ] ...would give you related field 1 related field 2 etc. You would need to create the "yourRelatedRecords" value list, that's easy enough. The tricky part is pre-pending each item with "First," "Second," etc.
-Queue- Posted June 28, 2004 Posted June 28, 2004 Yes, but that's going beyond the original question of how to do it using just a calculations. Setting the ordinal values using VLI could be quite a bit more complicated than looping through the related file, I would think.
Recommended Posts
This topic is 7792 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 accountSign in
Already have an account? Sign in here.
Sign In Now