It seems that what you want to do is use the Iterator's get() method; something like this:

<cfscript>
   startBalanceRecord =
application.Reactor.createRecord("tblStartBalance");
   startBalance =
startBalanceRecord.load(LeaveUserID=1,LeaveYear=2005,LeaveType=1);

   leaveBalancesIterator = startBalance.gettblLeaveBalanceIterator();
   leaveBalancesArray = leaveBalancesIterator.get(LeaveMonth=1);
   leaveBalances = leaveBalancesArray[1];

</cfscript>


That should return what you're looking for (the get() method returns an array of objects). Of course you'll want to check to make sure the array actually contains something before trying to get the first (and only) item, but you get the idea.

Christopher Bradford
Alive! LLP

----- Original Message ----- From: "Byron Raines" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, October 19, 2006 9:36 PM
Subject: [Reactor for CF] Iterator question


I have the following iterator

<cfscript>
startBalanceRecord = application.Reactor.createRecord("tblStartBalance"); startBalance = startBalanceRecord.load(LeaveUserID=1,LeaveYear=2005,LeaveType=1);

   leaveBalances = startBalance.gettblLeaveBalanceIterator().getQuery();
</cfscript>

This returns the query I want.

I would like to return just a certain record from the iteration.

Can I do the following:

leaveBalances = startBalance.gettblLeaveBalanceIterator().getWhere().IsEqual("tblleaveBalance","LeaveMonth",1);

When I dump the results, I get a dump of "component reactor.query.where" and its methods.

Thanks in advance.

Byron




-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --








-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to