Accessing related records in beforeSave($record)

Archived from the Xataface Users forum.

barryrs — Fri Aug 26, 2011 4:49 am

Good morning.. and happy friday to y’all!!

I’m having trouble accessing my related records from the $record object, here’s what seems to happen..
beforeSave($record)
$trans = $record->getRelatedRecords(‘Allocations’); // fails: undefined method PEAR_Error::getOrderColumn() yyssw.. try..
$trans = $record->getRelatedRecords(‘Allocations’, ‘AllocID’); // fails: undefined method PEAR_Error::getSQL() .. ugh!!
$amount = $record->val(‘Amount’); // This works just fine though
print_r($record); // Yeay!! I can see the data I’m looking for!!

I guess what I’m asking is, am I doing something wrong in my effort to obtain the related records? Is there a better way?
(keeping in mind that I actually want to change something in the records…)

Thanks again,
-Baer


shannah — Fri Aug 26, 2011 6:57 am

Check the name of the relationship. Looks like it may not be finding it. Case sensitive.


barryrs — Sat Sep 03, 2011 6:06 am

Thank you… stupid question… hate when I do that…