Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Using portal rows in a calculation field


This topic is 7454 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

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...

Posted

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. wink.gif

  • Newbies
Posted

I had a good laugh reading your answer thank you smile.gif

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

Posted

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.

Posted

Yes, but that's going beyond the original question of how to do it using just a calculations. wink.gif Setting the ordinal values using VLI could be quite a bit more complicated than looping through the related file, I would think.

This topic is 7454 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.