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
Gareth HennedyGareth Hennedy 

Changing 'Case' in email template

Hi,

I am setting up an email template which I will distibute to colleagues and customers.  In some cases my colleagues have been entered into the system in upper case e.g JOHN SMITH which means that when I start the email with...

"Hi {!Contact.FirstName}" it is returning "Hi JOHN".  What I would like it to do is display as "Hi John".

I am not an administrator of the system so I would like to force the test into the correct case rather than edit the data at source.

Any ideas?
Rajendra RathoreRajendra Rathore

No way to do this in Salesforce that I'm aware of natively. You could write a apex trigger on contact object that will convert contact first name of Poper case  but that's development work
String toTitleCase ( String inStr ) {

    String outStr = '';
    for ( String word : inStr.trim ().split ( ' +' ) ) {
        outStr += ( outStr == '' — '' : ' ' )
               + word.subString ( 0 , 1 ).toUpperCase ()
               + ( word.length () > 1 – word.SubString ( 1 ) : '' );

    return outStr;
}


There is already a idea post in salesforce for allow proper case in salesforce : https://success.salesforce.com/ideaView?id=08730000000BqhkAAC
You can also vote for it.

Thanks,
Rajendra