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
FraidyFraidy 

Auto capitalize

There is an option in the validation rules to return all charachters in a field capitalized. Is there any way that I can set this up so that it only capitalizes the first charachter in the field? like for names....
 
Thanx!
Fraidy
JakesterJakester
As long as you have Enterprise Edition or higher, totally! This would be a workflow. Reply back if you have EE+ and I can go over the specifics.
FraidyFraidy

Yes, I have EE. How would I do this?

Thank you so so much!!!!

JakesterJakester
Say you wanted to do it for the Opportunity name. Your workflow rule will be:
 
Code:
UPPER(LEFT(Name,1)) <>  LEFT(Name,1)

 And then assuming that the name field can only be 80 characters, your field update to the name field will be:
 
Code:
UPPER(LEFT(Name,1)) & RIGHT(Name,79)

 Try that out - see how it works!
FraidyFraidy

Wow, this is really cool, just one bug - when I put in a name:

jake

it returns:

Jjake

how can I fix that?

Thank you so so much!!

Fraidy

JakesterJakester

Ah! My mistake - change the code to

Code:
UPPER(LEFT(Name,1)) & Mid(Name,2,79)


If that doesn't work, try changing the "2" to a "1".

 

FraidyFraidy

It worked!!! (with the "2")

Thank you so so much for your help!!!

:smileyvery-happy:

Fraidy

JakesterJakester
You're very welcome!
rpr2rpr2

Jakester.

That was cool!  Want to tackle a more complex formula that would simulate the Excel PROPER function?  That is capitalize the first letter, plus the letter after any spaces.  e.g unusual worldwide gifts co would become Unusual Worldwide Gifts Co

Rhonda

 

JakesterJakester

Hi Rhonda,

I'm pretty sure that's going to require Apex code written on a trigger, and I'm not nearly smart enough to figure that one out. www.ezsaas.com is, though, and I highly recommend them for all your customization needs!

Adrian-EAdrian-E
Great stuff!
Would there be any formula which would capitalize the first letter of each word in an undefined (changing) number of words?

I would like my agents case description to be capitalized: only the initial letter of each new word. Sometimes there are 4 words, and sometimes there would be 10.
TGHTGH
Awesome! This is exactly what I've been looking for the past four hours.
FraidyFraidy
Adrian, (or anyone else who can help) did you figure out how to get this done? If yes, please share. I would love to do this too!
Thanx!
Katharina Kroon ThielsenKatharina Kroon Thielsen
Did anyone find an answer on Fraidy and Adrian's answer I have the same issue!