10

I recognize that State and Country Picklists are still a "Beta" feature, but does anyone know if, in Summer 13, its possible to get at the State and Country Picklist Values through either the Apex Schema Describe information or the API? I've heard that there is a distinct field called '[Mailing|Billing|Shipping][State|Country]Code' and corresponding to each Country or State field on standard objects, however this does not appear to be exposed through either Apex or the API --- even after State and Country Picklists are enabled in an org, both the API and Apex Schema Describe info for the State and Country fields still say that they're of DisplayType "STRING", and there's no Picklist Entries available for them.

Does anyone know of a way to get at these picklist entries from Apex Schema describe info, from the API, or some other way besides the native layouts or the apex:inputField tag? These values must be out there (somewhere) on the Salesforce Platform for orgs that the feature is enabled in...

10

Looking through the Spring 13 release notes (pg 121) I would expect the new fields to have "Code" appended. E.g. Account.ShippingCountry becomes Account.ShippingCountryCode.

This lines up with the online docs for Account:

ShippingCountryCode (beta)
Type picklist
Properties Create, Filter, Group, Nillable, Sort, Update
Description The ISO country code for the account’s shipping address.

Is your connection to the API or Apex class metadata using api version v28.0?

See also:

  • Yep, changing my Apex Classes to API v28.0 was the key! – zachelrath Jun 25 '13 at 13:16
3
SELECT BillingCountryCode FROM Account
SELECT BillingStateCode FROM Account
  • SFDC Workbench - above executes successfully (V28.0 org)
  • Apex testmethod - executes successfully if class is V27.0
  • Apex Execute anonymous Apex within Eclipse IDE V24.0 - fails 'no such column error'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.