Back

Explore Courses Blog Tutorials Interview Questions
0 votes
4 views
in Salesforce by (11.9k points)

I want to create an integer custom field on an object. I see that I can create a custom field of "Number" but that seems to return a decimal type. Mostly this is annoying as I plan to use the field as an Integer and everywhere I'm using it in code I have to cast it to an Integer. None of the other field types seem to be even close - the only other field type that even seems to hold a numeric type is Currency.

I've adjusted the number after the decimal fields to (3,0) - three numbers before the decimal, zero numbers after the decimal. It's still returning a decimal.

Is it even possible to create an integer? Is casting it every time I need it considered the "best practice"?

1 Answer

0 votes
by (32.1k points)

It is not possible for you to create an integer type. As you already know, the number results in a decimal. If you'd like to review it as an integer you just cast it.

Be a salesforce certified administrator by going for Intellipaat’s Salesforce course!

Browse Categories

...