If the relationship to the related table does not specify a sort order, data from the most recently added record will be returned by the Last function.
Last ( Relatedtable::TextField) would thus return the text from the most recently added record that is related to your main table and for which TextField is not empty.
Thanks, that could work. I would prefer if it could specifically find the record with the most recent date field (as the date field can be altered at any time), but if that will complicate things too much, your first suggestion would work.
That's just the most straight forward approach. You can also specify a sort order in a relationship to this file that sorts the records by date in ascending order. By using a different table occurrence for the related table, this change need not affect your current portal nor any other references to this table. So if you have this relationship:
MainTable::PrimaryKey = SecondaryTable::ForeignKey
but specify a sort order for SecondaryTable that sorts by the date field in descending order....
Then a reference to SecondaryTable from the MainTable will automatically refer to the related record with the most recent date. This assumes you don't have two related records with the same date.
I tried to do that, but the final date field in the main table wouldn't refresh. It's good to know that it should work, and that I probably just need to make sure that all of my fields are set to update automatically. Thanks!
First, make sure that the date field is really a field of type date or it won't sort correctly.
If that wasn't the issue, feel free to tell me exactly how it "didn't work" and I may be able to guide you through that to get it to work.