+ Start a Discussion
ClaiborneClaiborne 

Default Address Field Lengths?

In salesforce.com, several entities (contact, account, lead, etc.) have one or more "address" fields. When you look at the wsdl, you can see that the "address" is actually comprised of several fields - street1, street2, street3, city, state/province, postal code, and country.
 
The problem is that the wsdl does not tell you the maximum field lengths for the various components. During some importing, I have discovered that the city field can only be 40 characters.  Short of running a series of tests, can anyone provide the limits on the various fields that make up an address.
 
It is the sort of thing that should be published somewhere.
SuperfellSuperfell
Look at the describeSObjets call, it includes reams of metadata about all the fields in the system.
ClaiborneClaiborne
I followed Simon's advice (somewhat) and used the sforce explorer tool.
 
The "address" record is made up of the following:
 
Street (Text Area, 255 characters)
City (Text, 40 characters)
State (Text, 20 characters)
Postal Code (Text, 20 characters)
Country (Text, 40 characters)
JasonICJasonIC
A more current description of address attributes (on accounts, at least) may be found here (https://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_account.htm)
Gnana SilaparasettiGnana Silaparasetti
Updating field lengths incase if anyone lands up here.
  • Address.Street (TextArea, 255 characters)
  • Address.City (String, 40 characters)
  • Address.State (String, 80 characters)
  • Address.PostalCode (String, 20 characters)
  • Address.Country (String, 80 characters)
ClaiborneClaiborne
Thanks. It only took 3 or 4 years to get this question answered.
Mark Kellman 27Mark Kellman 27
Hey Claiborne, looks like it actually took 10 years.  Not bad. :-) Seriously though, thanks to everyone who researched and provided the field lengths because this is very helpful for integrations.
System 181System 181
thanks so much for providing this answer, can the fields length ( city ) can be changed ?
ClaiborneClaiborne
System 181 - As far as I know, the City field is a standard field. You cannot change parameters on a standard field, like the City field in the address.

Possible work-arounds . . .
  • Add a custom City field that allows more characters.
  • Somehow include the long city name as part of the multiple line 255-character text area used for Street Address.
For those interested in addresses, it is on the "road map" to allow adding the a standard address field type (with Street, City, State, Country, and Postal Code sub fields) as a custom field to custom objects and to standard objects for multiple addresses. According to this - https://trailblazer.salesforce.com/ideaView?id=08730000000BrVWAA0, it will be GA in the Spring 22 release, available now in preview.