Display Numeric Fields Without Commas Using Validation Rules

Matt/ February 23, 2016/ Salesforce

When wanting to display a number field without a comma, I’ve generally made a number field then a formula text field to display the value as text:

TEXT (UN_or_NA_Number__c)

But that makes it ugly when you’re setting up the view and edit layouts.

Not any more!  I hadn’t considered this before, but why not just make a text field to begin with and use a validation rule to make sure the value is numeric?  Use this code to validate your field:

NOT(ISNUMBER( UN_or_NA_Number__c ))

This is so much nicer and easier to use than having to create duplicate display fields and managing the layouts.

Share this Post

About Matt

Matt is a seasoned Salesforce Developer / Architect, with implementations of Sales Cloud, Service Cloud, CPQ, Experience Cloud, and numerous innovative applications built upon the Force.com platform. He started coding in grade 8 and has won awards ranging from international scholarships to internal corporate leadership awards. He is 37x Certified on the platform, including Platform Developer II, B2B Solution Architect and B2C Solution Architect.