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
Bailey CarlsonBailey Carlson 

Metadata API ListView and SearchLayout column names

I am trying to use the metadata webservice API in order to determine which columns are on List Views and Search Layouts for a custom or out of box object. However, the response I get from the web service has the column names in an unusual format like this,

<listViews>
	<fullName>crmc_grid__AllContacts</fullName>
	<columns>ACCOUNT.NAME</columns>
	<columns>CONTACT.FIRST_NAME</columns>
	<columns>CONTACT.LAST_NAME</columns>
	<columns>CONTACT.ADDRESS2_STATE</columns>
	<columns>CONTACT.ADDRESS2_COUNTRY</columns>
	<columns>CONTACT.REPORTS_TO.NAME</columns>
	<columns>CONTACT.ADDRESS1_CITY</columns>
	<columns>CONTACT.EMAIL</columns>
	<columns>crmc_grid__Level__c</columns>
	<filterScope>Everything</filterScope>
	<label>All Contacts</label>
</listViews>
My question is how can I then use these a-typical column names to reliably and generically detect which SOQL fields are being displayed? In most cases it seems like removing the hyphens would translate to the SOQL schema name, however there is no Address1 or Address2 fields on the Contact table and they correspond to the Mailing and the Other address instead. Is there some other API for mapping these field names to field metadata or schema names? If this can't be done then what usefulness is there to the ListView metadata?

Thanks,
Bailey

jschmidjschmid
Any update on this?
Bailey CarlsonBailey Carlson
Still unresolved issue, I found the same question on stackoverflow so you can check for updates there as well,
http://salesforce.stackexchange.com/questions/40243/parsing-listviews-columns-from-the-metadata-api?noredirect=1#comment54668_40243
swathiswathi
If I understood correctly, you need the api names for mailing address like mailing city, mailing state. If so, please check this link:

http://www.salesforce.com/us/developer/docs/api/
Bailey Carlson (CRMCulture)Bailey Carlson (CRMCulture)
swathi: I don't think you do understand correctly. The column names listed under standard objects in the API do not match the names returned in the metadata listView result. Since the names cannot be associated to the actual field by name then I can't understand how they can be used to do something like build a dynamic SOQL statement or to get field describes, or really anything at all. Am I missing something?