views:

190

answers:

1

We recently migrated from coldfusion 7 to coldfusion 8. One of our reporting flex apps takes the returned results of a cfc query and adds up a column in that ArrayCollection. It worked on coldfusion 7, but now, in coldfusion 8, it sees that column as a string instead of a number, which is causing NaN errors on negative values. Its a numeric(12,2) NOT NULL in the database. It works in Flex when I cast it as a Number(var) but I'd hate to do that in all of our projects... has anyone ran into this problem?

+3  A: 

We actually just saw this yesterday too. CF 7 and CF 8 was the only difference. Doing this does not work:

var num:Number = e.result.MYNUMBERFIELD as Number;

but this does:

var num:Number = Number(e.result.MYNUMBERFIELD);

I don't think your looping and making a csv is related. I think it is a pure CF8 issue. I'll look in the bugbase and see if I notice anything like this. We haven't had time to research it further yet. I am also interested in what the difference is between those two cast methods.

Update 2009-09-24:

On at least one one machine here locally, the Cumulative Hot Fix 3 for ColdFusion 8.0.1 has fixed this issue. You can get this hotfix here: http://kb2.adobe.com/cps/511/cpsid_51180.html. That page also has instructions for installing the hotfix if necessary.

Note for anyone else looking at this question: Adobe recommends that you apply CHF3 to ColdFusion 8.0.1 only if you are experiencing one or more of the issues that are listed on that page. If you are having the issue in this question of course that means you.

Ryan Guill
I've also tried casting in the query itself to Numeric(12,2) and that did not help. I'll let you know if I find anything as well.
Chris Klepeis
Just an update... still havent found anything, what I'm going to have to do I guess is go through and update my projects casting as a Number where applicable. Seems like it only happens when I try to set a numeric variable to my ResultEvent object
Chris Klepeis
I looked through the public bugbase and didn't find anything like this. Im going to dig a little bit more though.
Ryan Guill
Please check out the update to my answer, I think we found a solution.
Ryan Guill
I guess this worked for you as well then?
Ryan Guill
We ran the update and it doesn't appear to have worked :/ We just casted where necessary. Also columns in our datagrids that have dollar amounts were not sorting properly on cf8 so we had to implement a sortCompareFunction.... tedious
Chris Klepeis