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
TGHTGH 

Require Capitalization for Field Except For ...

Here's a seemingly easy formula that I can't tweak to make it do what I would like.

 

We would like the first letter of a Solution field, Solution Title, to be capitalized. I'm setting up a validation rule to require this. Here's the Error Condition Formula:

 

OR(
BEGINS (SolutionName, "a" ) ,
BEGINS (SolutionName, "b" ) ,
BEGINS (SolutionName, "c" ) ,
BEGINS (SolutionName, "d" ) ,
BEGINS (SolutionName, "e" ) ,
BEGINS (SolutionName, "f" ) ,
BEGINS (SolutionName, "g" ) ,
BEGINS (SolutionName, "h" ) ,
BEGINS (SolutionName, "i" ) ,
BEGINS (SolutionName, "j" ) ,
BEGINS (SolutionName, "k" ) ,
BEGINS (SolutionName, "l" ) ,
BEGINS (SolutionName, "m" ) ,
BEGINS (SolutionName, "n" ) ,
BEGINS (SolutionName, "o" ) ,
BEGINS (SolutionName, "p" ) ,
BEGINS (SolutionName, "q" ) ,
BEGINS (SolutionName, "r" ) ,
BEGINS (SolutionName, "s" ) ,
BEGINS (SolutionName, "t" ) ,
BEGINS (SolutionName, "u" ) ,
BEGINS (SolutionName, "v" ) ,
BEGINS (SolutionName, "w" ) ,
BEGINS (SolutionName, "x" ) ,
BEGINS (SolutionName, "y" ) ,
BEGINS (SolutionName, "z" )
)

 

(Please forgive the weird spacing at the end of the above lines. I had to put spaces there so the forum wouldn't think I was trying to insert a smilie.)

 

Seems very straitforward, and it does what I would like. If they enter "here is a solution," it's going to throw an error and require them to enter "Here is a solution."

 

BUT, there are certain Solution Titles that we would like to allow to be lowercase. We have certain products that intentionally begin with a lowercase letter (like the iPod or eCommerce, that kind of thing). If the user enters a Solution Title that begins "iPods are really neat," I don't want to to throw out an error.

 

Any ideas? I thought I could get around this by using the NOT function or another OR function, but that seems to REQUIRE it to be "iPod" or "eCommerce" or whatever term I'm trying to tell it is okay.

 

Thanks!

Message Edited by TGH on 04-22-2009 08:35 AM
Message Edited by TGH on 04-22-2009 08:36 AM
Message Edited by TGH on 04-22-2009 08:37 AM
TGHTGH

One solution is to have an additional validation rule.

 

BEGINS(SolutionName, "iPod" )

 

Would display the error message:

 

The Solution Title cannot begin with "iPod"

 

But there could be times when a user would want to insert the word "iPod" at the beginning of a Solution Title.

Message Edited by TGH on 04-22-2009 08:54 AM
rpr2rpr2

Are you willing to make the assumption that if the second letter is capitalized and the third one is not then the first letter should not be capitalized?  If so, you may want to consider using Regex to create your validation rule.

 

If you are not familiar with Regex, check out Online Help, including the link included in the tips portion.

hhuiehhuie

Not sure if this will help but we had a issue starting this year where we had text fields for Sales Reps for each specialty and needed the spelling to be correct so that it rolled up to the correct teams.  There is a function called VLOOKUP().  You would need to create an Object called Solution Exception with list of names to exclude:

 

Your current formula &&

 

NOT(BEGINS(SolutionName,

 

VLOOKUP( $ObjectType.Solution_Exception__c.Fields.Name , $ObjectType.Solution_Exception__c.Fields.Name, SolutionName )))

 

 I think this is how it should look but have not tested this funcation in a NOT and BEGINS funcation.  Only issue if this does work is that you'll have to maintain this Solution Exception object.

TGHTGH

Actually, I found the solution in another thread. We actually went with a workflow rule:

 

Criteria formula:

UPPER(LEFT(FieldName,1)) <> LEFT(FieldName,1) ------> If the first letter is not capitalized.

 

Action:

UPPER(LEFT(FieldName,1)) & MID(FieldName,2,2000000000) ----------> Capitalize the first letter, and take no action on the other letters.

 

Works great, and automatically makes the change instead of justing displaying an error and having the user change it.

 

For instances where we don't want to change the first letter, I added the following to the first formula:

AND(

UPPER(LEFT(FieldName,1)) <> LEFT(FieldName,1),

NOT(BEGINS(FieldName, "iPod")),

NOT(BEGINS(FieldName, "iMac"))

)