+ Start a Discussion
JBabuJBabu 

To convert states to upper case and save them

Hi,

 

I have to store 2 digit state name like (IL -Illinois, NY - New York...). Even though I entered in lower case, I need to store them in upper case.

Can we do this without apex code? or is this possible only with usual way of having a trigger to check the state codes and compare and update and return the upper case code.

Please let me know your thoughts.

 

Thanks,

JBabu.

 

Best Answer chosen by Admin (Salesforce Developers) 
tomcollinstomcollins

I think it should be possible to set up a Workflow Rule (Create/Workflow & Approvals/Workflow Rules) with a criteria to run whenever field_name is not null, and have it to do a Field Update using the formula UPPER(field_name).

All Answers

colemabcolemab

You could use the salesforce excel addin to correct those that are in lower case and are already in the system.

 

Then you could add a validation rule (see examples in documentation see page 6 here) to prevent new entries from being lower case. 

 

All without any apex.

 

JBabuJBabu

Hi Colemab,

 

I checked examples in page 6 but they don't seem to be converting lower case state codes to upper case once.

Please correct me if I am wrong  or could you share the rule here if you possible. Thanks for your help.

 

Thanks,

JBabu.

colemabcolemab

Please re-read my post.  I indicated that you could fix existing lower case entries by using the salesforce excel connector.   You will need to query the data (probably all accounts? maybe contacts?) and then use the UPPER formula in salesforce across all of your rows and then use the connector to update those records.   This will remove any existing lower case entries.

 

The validation rule is used to prevent lower case entries from being added in the future as the rule only has upper case values. 

 

Depending on the number of records you have and how familiar you are with excel and the connector, this is an easy way of doing it w/o apex code.

tomcollinstomcollins

I think it should be possible to set up a Workflow Rule (Create/Workflow & Approvals/Workflow Rules) with a criteria to run whenever field_name is not null, and have it to do a Field Update using the formula UPPER(field_name).

This was selected as the best answer