function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
jf317820jf317820 

flex relationship query problem

perhaps i'm doing this incorrectly, but I'm trying to grab the User name using the following code:

Code:
for (var i:int=0;i<qr.records[j].Responsible_Party__r.records.length;i++)
{
  partyArray.addItem( { id:qr.records[j].Checklist_Comment__r.records[i].Id, who:qr.records[j].Checklist_Comment__r.records[i].User__r.Name, item:qr.records[j].Checklist_Comment__r.records[i].Checklist_Line_Item__c
} ); }

 
I keep getting "TypeError: Error #1010: A term is undefined and has no properties." on the "who" line of the addItem method.  I know it's there because I've debugged it in Flex and I've tested the SOQL query in apex explorer 8.0. 

Any ideas?
AcronymAcronym
Looks like you are iterating the Responsible_Party__r records and using the index from that iteration for the Checklist_Comment__r field.

???

I'd have to see the full SOQL to be any more help.
jf317820jf317820
haha.  Thank you!  I was iterating the wrong records.  Sometimes you just need a second set of eyes...I've been working on this application non-stop for 2 weeks as evidenced by my previous message.

I guess the fact that it wasn't breaking on the other lines was throwing me off.

Thanks again.