April 3, 200718 yr Hi, I have a one to many relation where I would need only the last generated record out of the many-table. How can I do that? I always end up with the first dataset. Thank you, Bernhard
April 3, 200718 yr You need to sort the relationship or the portal. If the related data have serial numbers you can sort by them descending. Or you can sort by record creation timestamps, though this is less reliable if you create records in less than a second. If you sort the relationship, you'll be able to access the last record in calculations and just everywhere you use this relationship. That is if you have Related::Some Field, it will return you a value from the last record. If you sort a portal, then you'll see the last record only in the first row of the portal.
April 3, 200718 yr It depends what you need it for. For example, if you need a value from the last related record, you can leave the relationship unsorted (which means sorted by creation order), and use: Last ( relationship::field ) to return the value from the last record.
April 12, 200718 yr Author Thank you for your help - sometimes the issues are so obvious that it is a little embarassing not to have found the solution myself.. ;)
Create an account or sign in to comment