July 31, 201312 yr Is there a way to loop through the records in a portal, something similar to getting the next record in found set? GetNthRecord(field:Get(RecordNumber)+1)
July 31, 201312 yr Author Maybe I figured it out, tell me if this sounds right. I can use GetNthRecord(field:Get(RecordNumber)) , it's that I have to evaluate the calculation in the context of the records that appear in the portal and not the records that are in the layout's table. That seems to work, Is that it?
August 1, 201312 yr Maybe I figured it out, tell me if this sounds right. I can use GetNthRecord(field:Get(RecordNumber)) , it's that I have to evaluate the calculation in the context of the records that appear in the portal and not the records that are in the layout's table. That seems to work, Is that it? Not sure what calculation you're talking about. GetNthRecord works via the related set and the sort order of a relationship, not any portal (actually, you don't need a portal): simply use a related field, and in a loop, make sure that your loop terminates, i.e. count the number of related records and use that value as exit condition. Actually, before the introduction of List() in 8.5 (or thereabouts), GetNthRecord was used for that purpose. So starting from the current context, GetNthRecord ( my´RelatedTable::myField ; n ) will give you the contents of the field myField in the nth record of the related TO, as defined by the sort order for the relationship with myRelatedTable. All of which (and more) you can read in the Help System, btw. If you need to loop through just the records that appear in a filtered portal and/or rely on the portal's sort order, than AFAICT you need to loop via Go to Portal Row.
Create an account or sign in to comment