Accessing related records in beforeSave($record)

A place for users and developers of the Xataface to discuss and receive support.

Accessing related records in beforeSave($record)

Postby 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
barryrs
 
Posts: 14
Joined: Tue Feb 15, 2011 11:37 am

Re: Accessing related records in beforeSave($record)

Postby shannah » Fri Aug 26, 2011 6:57 am

Check the name of the relationship. Looks like it may not be finding it. Case sensitive.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Accessing related records in beforeSave($record)

Postby barryrs » Sat Sep 03, 2011 6:06 am

Thank you... stupid question... hate when I do that...:(
barryrs
 
Posts: 14
Joined: Tue Feb 15, 2011 11:37 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 32 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved