I’d like to get all the records related to the current record selected in the current foundset, BUT WITHOUT A VALUELIST.
So I’d like the value list functionality without having to decalre the value list, because I want to get the related values, even if no valuelist are defined.
And I want to get the related values of the current record without affecting my current foundset
I’ve found this :
convertFoundSet
Converts a foundset based on a one-to-many relation; returns a foundset of all related records based on a specified relation.
But it seems to affect my foundset and it seems to return all the related values of all the records of my foundset.
I only want the related values of the current record I’m on.
Thanks
And what do you want to do with those “values” (actually you get records)? You can do something like
// Get hold of the record you are on
var vMyRecord = foundset.getRecord(foundset.getSelectedIndex())
if (utils.hasRecords(vMyRecord.relation)) {
for (var i = 1; i <= vMyRecord.relation.getSize() ; i++) {
// Get a related record
var vRelatedRecord = vMyRecord.relation.getRecord(i)
// Get a related "value"
var vMyValue = vRelatedRecord.field
}
}