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
JayJay 

Custom Account Fields not showing up in response SOAP message

Hello All,

I am having trouble retrieving my custom fields via the SOAP describe method.  Anyone have any ideas on what I need to acquire these fields. Here is the request message:

 

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="salesforce" xmlns:types="salesforce/encodedTypes" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
 <soap:Header>
  <headerStruct>
   <session_id xsi:type="xsd:string">H6efA3Lip30M2orU1.xNMPWYUhgt1Zz5s1KeNxu4r.XYpcKGUIQraAL0KR0KJ9yvJJa2cHSK.XeiHhakibmVNPbtzKggVlhL</session_id>
   <version xsi:type="xsd:string">2</version>
  </headerStruct>
 </soap:Header>
 <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  <qry1:describe xmlns:qry1="sfconnector:SalesforceConnector" type="methodCall">
   <type xsi:type="xsd:string">account</type>
  </qry1:describe>
 </soap:Body>
</soap:Envelope>

 

Thanx!

DevAngelDevAngel

Hi Jay,

There is a hole in the usability of custom fields through the API.  The hole is exposed when you create a customFieldDefinition object (use the API to create a custom field) and then try to use it in the API or try to see it with the describer.  The problem is that to "see" a custom field, or any field for that matter, the field must be associated with a layout.  A layout is a specific screen layout used by the salesforce.com application.  These layouts also have sharing associated with them so that you can create several different layouts of the same page and assign the different "views" to different groups of users.

If you created your field using the API, you will need to go into the admin of the salesforce.com application and associated the field with a layout.  If you created the field through the salesforce.com ui, make sure that it is associated with a layout and that you have permissions on the layout.

JayJay

Does this also apply to querying on that custom field?

I added the layout for my login and it worked for the describe method but no data is showing up for the query method.  Also, I am using the "cf_" prefixed field name in the routine.

DevAngelDevAngel

Hi Jay,

You will use the "cf_" underscore as if there were no other field name. 

I'd have to see the query message to determine the problem.