Ensuring State Abbreviations Compliance in Addresses
Hi all, Starting a new project and one of my entities has an address field. At first I was going to have the user type in a state. But I realized I could get NY, ny. New York, new york, etc. and not have consistency. So I created a new module called CoreFunctionality thinking I could put shared resources in here across my entire app. I was assuming the right way to do this is to create an Enumeration and enter all of the state abbreviations in there. Is this the correct workflow? If so how would I reference this enumeration on my AddEdit page so the user selects it? Thanks for your help! Newbie for sure :)
If you create an enumeration with all the state names, use that enumeration for the state attribute in all your tables. Then when a user fills out an address section, the state field would be a drop down and not a free form input.
If you want to go a step further, you could create an entity called "state profile" with an attribute called "name" that is the states enumeration you just made and also add an attribute for full name, abbreviation, etc. Then you could create a record for each state in the enumeration. Then you could use this table as a reference in case you ever need to show the full name, etc.