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
Philip Meldrum08237737677563425Philip Meldrum08237737677563425 

List View Metadata Field Names vs API Field Name

We are using the Metadata API to inspect List View objects, and have managed to find the Filter Fields, but they are using a different naming convention.

For example the API name for Fax in Accounts is 'Fax', but in the Metadata name in the filter fields is ACCOUNT.PHONE2

The same mixing up of names seems to happen with ALL standard object, though custom objects & fields simply use the API Name.

Does anyone have any idea how we can map the Metadata name ( ACCOUNT.PHONE2) to the API Name (Account.Fax)?
Philip Meldrum08237737677563425Philip Meldrum08237737677563425
Thanks @Matthews
We have successfully used the 'customobject' as detailed in this link to get the details for the ListView.
The problem is the value returned by the metadata api.

Here is a sample API from http://www.salesforce.com/us/developer/docs/api_meta/index_Left.htm#CSHID=meta_listview.htm|StartTopic=Content%2Fmeta_listview.htm|SkinName=webhelp

     <listViews>
        <fullName>My_Mileages</fullName>
        <booleanFilter>1 AND 2</booleanFilter>
        <columns>NAME</columns>
        <columns>CREATED_DATE</columns>
        <filterScope>mine</filterScope>
        <filters>
            <field>NAME</field>
            <operation>equals</operation>
            <value>Eric Bristow</value>
        </filters>
        <filters>
            <field>City__c</field>
            <operation>equals</operation>
            <value>Paris</value>
        </filters>
        <label>My Mileages</label>
    </listViews>


This is fine:, the filter uses the custom field name City__c, which is the API name.
The problem comes when STANDARD fields are used, so for example the standard field 'Fax' has the following definition in the filters:

        <filters>
            <field>PHONE2</field>
            <operation>equals</operation>
            <value>020 765 9787</value>
        </filters>

The instead of the api name 'Fax' you get 'PHONE2'
So our problem is how to map these specials ListViewFilterNames to API Names.

Maimoona S.Maimoona S.
Hi Philip ,

Have you ever get the solution of this problem ?
I have another problem using metadata Api . I am getting list views and list view filters using metadata api . 
This works as required in one org , but when I tried in another org I can get List views but not the list views filters.(This org have managed package so have a namespace prefix . does this any difference ? )

This is the xml I get in return 
 
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <env:Header>
    <SessionHeader xmlns="http://soap.sforce.com/2006/04/metadata">
      <sessionId>xxxxxxxx</sessionId>
    </SessionHeader>
  </env:Header>
  <env:Body>
    <readMetadata xmlns="http://soap.sforce.com/2006/04/metadata">
      <type>ListView</type>
      <fullNames>Opportunity.ClosingThisMonth</fullNames>
    </readMetadata>
  </env:Body>
</env:Envelope>

<!--Responae-->

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
    <readMetadataResponse>
      <result>
        <records xsi:nil="true"/>
      </result>
    </readMetadataResponse>
  </soapenv:Body>
</soapenv:Envelope>



I am stuck in this issue and really need someone's help. Please if you can suggest what the problem might be , I will be very thankfull to you.

Thanks in advance