Jeff Stevens
02/17/2023, 8:18 PM<cfloop index="i" from="1" to="#rc.tblFormDataForFormFK.recordCount()#">
<cfscript>
// Each row of the submission viewer page is stored in a submission record query object
local.submissionRecord = rc.submissionResponses.filter( function(_submissionRecord)
{
return _submissionRecord.FormDataFK is rc.tblFormDataForFormFK.getRow(i).FormDataPK;
});
</cfscript>
...
So what I'm doing is I'm calling queryFilter at the top of a loop. In Lucee, this worked as expected: The function called stored a query object within local.submissionRecord containing all of the rows from rc.tblFormDataForFormFK that had the same FormDataFK column. It appears queryFilter iterates on every row of the query it is called for, as placing a writeDump inside of the queryFilter callback function printed a message for each row in rc.tblFormDataForFormFK . For every invocation at the start of the loop, this works.
Switching over to Adobe ColdFusion, it seems like the queryFilter function doesn't work the same way. The first step the function ran and it worked correctly, producing the same result as Lucee. On the second step of the loop, it only seemed to iterate over several of the rows within the queryFilter function, as the same writeDump statement as I mentioned earlier did not print a number of messages nearly equal to the number of rows in the query being filtered. On the 3rd step of the outer loop, no write dump messages were printed.
My question is, is this intentional behavior? What can I do to get queryFilter to filter over the entire query on each step of the outer loop?Rodney
02/17/2023, 8:24 PMRodney
02/17/2023, 8:26 PMJeff Stevens
02/17/2023, 8:26 PMRodney
02/17/2023, 8:29 PMJeff Stevens
02/17/2023, 8:30 PM