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
Nikki.ax79Nikki.ax79 

Case of ID field

I'm working on the Salesforce 4.0 Partner API coding with Java 1.4.2_03.

When I describe the Contact entity the ID field has a label 'Contact ID' a name 'Id'. I have built an application which several Salesforce clients use, and hence is dynamic in nature. The problem arises when I query a contact for the 'Contact ID' field. The field is returned labeled 'id'. The change in case prevents my application from recognizing that an id was found because it is looking for 'Id' and not 'id'. I can overcome this with code on the client side, but it is a lot of code and seems inconsistent to me.

Is there a reason for the difference in case for field names between a describe on an entity and a query on an entity?
SuperfellSuperfell

As far as i can tell, Id is used in both describe and query, here are the snippets from the soap responses

    <fields>
     <autoNumber>false</autoNumber>
     <byteLength>18</byteLength>
     <createable>false</createable>
     <custom>false</custom>
     <defaultedOnCreate>false</defaultedOnCreate>
     <digits>0</digits>
     <filterable>true</filterable>
     <label>Contact ID</label>
     <length>18</length>
     <name>Id</name>
     <nameField>false</nameField>
     <nillable>false</nillable>
     <picklistValues xsi:nil="true"/>
     <precision>0</precision>
     <referenceTo xsi:nil="true"/>
     <restrictedPicklist>false</restrictedPicklist>
     <scale>0</scale>
     <soapType>tns:ID</soapType>
     <type>id</type>
     <updateable>false</updateable>
    </fields>

 

and the snippet from query

<records xsi:type="sf:sObject" xmlns:sf="urn:sobject.partner.soap.sforce.com">
     <sf:type>Contact</sf:type>
     <sf:Id>00330000003cKXtAAM</sf:Id>
     <sf:Id>00330000003cKXtAAM</sf:Id>
</records>

Do you have a trace of a response that contains id rather than Id ?