NUMBER_OUTSIDE_VALID_RANGE in Salesforce: what it means and how to fix it

Short answer: NUMBER_OUTSIDE_VALID_RANGE means you sent a value to a Number, Currency or Percent field that doesn't fit the field's size. Each numeric field has a fixed number of digits before and after the decimal point, and a value with too many digits on the left side is rejected rather than rounded.

Number, Currency and Percent fields in Salesforce are defined in Setup with a length, the digits allowed to the left of the decimal point, and a number of decimal places. The API exposes the same definition as precision (all digits) and scale (digits after the decimal point). When a value's whole-number part needs more digits than precision - scale, the save fails with:

NUMBER_OUTSIDE_VALID_RANGE: Quantity: value outside of valid range on numeric field: 1.9999999999E10

The text before the colon is the field label, and the number at the end is the value Salesforce refused, often printed in exponent form.

Why it happens

  • The field is smaller than the data. A custom field created with a length of 3 and 2 decimal places tops out at 999.99. Revenue figures, order totals or employee counts from a larger system overflow it immediately.
  • Unit mismatches. Amounts exported in cents, durations in milliseconds or IDs stored as numbers are many digits longer than the field designer expected.
  • Decimal separator confusion. A value written with a decimal comma can be parsed as a much bigger whole number when the importer expects a period.
  • Fields that differ between orgs. A sandbox field defined with fewer digits than the production version rejects values that production accepts.
  • Generated or test values. Random numbers picked without looking at the field definition easily exceed a narrow field.

How to fix it

  1. Read the field definition. In Setup, open the field in Object Manager and note its length and decimal places, or run a describe and read precision and scale. The whole-number digits allowed are the length, or precision minus scale.
  2. Find the offending rows. Filter your file for values whose whole part has more digits than the field allows. The value in the error message tells you where to start.
  3. Correct the data. Convert units, fix separators, or cap values that are clearly wrong before loading.
  4. Widen the field if the data is right. If the business really has values that large, increase the field's length. Remember the overall limit of 18 digits.
  5. Compare orgs. When a load works in one org and fails in another, diff the field's length and decimal places between them.

How Syntharil handles it

Syntharil classifies NUMBER_OUTSIDE_VALID_RANGE as a data format error, meaning the generated value was the problem rather than the org. The classifier also matches the message text "value outside of valid range", so the error gets the same label whichever code carries it. When seeding, Syntharil reads each field's precision and scale from the org's describe, and its default generators for integer and decimal fields keep values within those digit limits. Currency and percent fields use fixed default ranges instead, so a custom field defined with very few digits can still overflow. In that case, set a range for the field in the Configure Fields step. A range you set yourself is used as-is and isn't checked against the field's digits. Failed rows are not retried automatically during the run. They are listed with Salesforce's message under the "Syntharil can fix" group in the run's errors.

FAQ

What are precision and scale on a Salesforce number field?

They are how the API describes a numeric field. Precision is the total number of digits and scale is how many of those sit after the decimal point, so the digits left of the decimal can be at most precision minus scale. In Setup the same field shows a length, which is the whole-number digits, and a number of decimal places.

Does NUMBER_OUTSIDE_VALID_RANGE fire for too many decimal places?

The usual trigger is the integer part, the digits to the left of the decimal point. Extra decimal places are normally rounded to the field's scale on save. If the error names a value with only a few whole digits, check the field's decimal places setting and how many integer digits that leaves.

Why does a value in scientific notation appear in the NUMBER_OUTSIDE_VALID_RANGE message?

Salesforce echoes very large numbers in exponent form, such as 1.9999999999E10. The notation is just how the rejected value is printed. Count the digits it represents and compare them with the integer digits the field allows.

Can a locale setting cause NUMBER_OUTSIDE_VALID_RANGE?

Yes. If a decimal comma is read as a thousands separator, 12,5 can become 125 or a coordinate can grow far past its intended size. Make sure files and integrations send numbers with a period as the decimal separator.

How large can a Salesforce number field be?

Number fields store at most 18 digits in total, counting digits on both sides of the decimal point. Any individual field can be defined smaller than that, and the field's own definition is what the value must fit.

All Salesforce errors →

Try Syntharil free