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
Singer-ClarkSinger-Clark 

Why does one get NUMBER_OUTIDE_VALID_RANGE errors?

I get this error in the results of a Bulk API upsert:

'NUMBER_OUTSIDE_VALID_RANGE:Normalized Score: value outside of valid range on numeric field: 100.0:normalized_score__c --'

The metadata for that custom object uses 'type': 'Number', 'precision': 10, 'scale': 8.

Is range referring to the value, as in a minimum and maximum value, that 100.0 is not between?

Or does it have to do with 'scale' or 'precision' (which seem plenty high to incorporate the number 100.0)?

More generally, how does one resolve this? I don't even know what "valid range" is in play here, so any help is much appreciated.
Singer-ClarkSinger-Clark
The answer is that scale is the number of digits allowed to the right of the decimal, and precision is the total number of digits, so (precision - scale) is the number of digits allowed to the left of the decminal.

I thought that if a number only had 2 digits to the right of the decimal, then you could still have 8 to the left, but it's not actually based on the specific number. All numbers get 8 to the right, and 2 to the left (as I had it configured in the question).

Thus the solution is to increase the precision from 10 to 11 (or keep precision the same, and decrease the scale).