You need to sign in to do that
Don't have an account?
Colin Lammers
Proper Case Fields
So I found a formula in this link that solves 75% of my formatting problems in salesforce (https://developer.salesforce.com/forums/ForumsMain?id=906F0000000927nIAA)
The problem is it's limited to the first three set of text queries in a field (e.g. John Deere Green but a fourth word like tractors wouldn't be impacted). I'm trying to figure out how to expand it past three words. Any help? The biggest impact this would have is in the address field (4242 John Wayne street). It'd be great to capitalize the S of street in that field.
The problem is it's limited to the first three set of text queries in a field (e.g. John Deere Green but a fourth word like tractors wouldn't be impacted). I'm trying to figure out how to expand it past three words. Any help? The biggest impact this would have is in the address field (4242 John Wayne street). It'd be great to capitalize the S of street in that field.
The formulas are not suitable at all for splitting/formatting text. I have played the game of writting this huge formulas but it is not the best solution.
As you noticed the current formula you found is already almost not updatable without help (for each new word, the formula becomes more complicated and there is a limit for the compiled formula quickly reached).
It is much more easy to write a trigger for these tasks of splitting/formatting text and the short apex code below is easy to understand and maintain.
The street can be multiline and the code below has almost no limit for the number of words (and lines) without any change needed for each new word.
word.trim().tolowercase().capitalize(); transforms " sTrEet " into "Street"
And if there is no other answer until now, it is perhaps because no one wants to play the game of the "ridiculous" formula anymore when you can write a short code of apex (but someone will perhaps write the formula you are expected over the next few days for the fun).
Regards
All Answers
The formulas are not suitable at all for splitting/formatting text. I have played the game of writting this huge formulas but it is not the best solution.
As you noticed the current formula you found is already almost not updatable without help (for each new word, the formula becomes more complicated and there is a limit for the compiled formula quickly reached).
It is much more easy to write a trigger for these tasks of splitting/formatting text and the short apex code below is easy to understand and maintain.
The street can be multiline and the code below has almost no limit for the number of words (and lines) without any change needed for each new word.
word.trim().tolowercase().capitalize(); transforms " sTrEet " into "Street"
And if there is no other answer until now, it is perhaps because no one wants to play the game of the "ridiculous" formula anymore when you can write a short code of apex (but someone will perhaps write the formula you are expected over the next few days for the fun).
Regards
You should also tried other forums (formulas are often solved by their experts everyday and many people like these challenges without limit)
https://success.salesforce.com/answers?feedtype=RECENT (https://success.salesforce.com/answers?feedtype=RECENT&criteria=BESTANSWERS)
Regards