Avoiding Number Formatting Problems in Salesforce.com Fields

An issue came up with a client recently that will help other Salesforce.com users I’m sure. The issue relates to the increasing use of unique and long numbers in business. From account numbers, merchant numbers, to Tax ID numbers, we have lots of numbers to keep tabs on.

Salesforce.com is a great place to keep these numbers. However, if you create a custom field and store them as numbers you will find your formatting probably will not be allowed or preserved.

A couple examples:

  • US Tax ID numbers are in the form of: 88-8888888. This number contains a dash after the first 2 digits. Social Security Numbers have the same problem with two dashes: 888-88-8888. Not allowed as a number with the dashes so you are forced to enter in the numbers by themselves, removing the intended formatting and giving you a new format: 888,888,888.
  • An account number with a vendor is 8847506644758 and can be saved as long as it is 18 or less digits before the decimal. However, when you view it, it shows 8,847,506,644,758 which is a little distracting to the eyes and confuses the fact that this number is an account number, not a numeric total of something else.

The solution in both of these cases is to only store numeric data that will be related to calculations in formulas, reports, etc. There will never be an example of subtracting two SSNs or adding merchant numbers together so storing them as numbers, even though they are, is unnecessary and cumbersome.

The rule should be:

  1. Only store numeric data as a number when it quantifies something.
  2. Otherwise, use text and include any spaces, dashes, or other characters that make it more easy to read and parse (i.e. 66898-9865-57377)

– Jon

Post a Comment

*Required
*Required (Never published)