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
gsmithfarmergsmithfarmer 

partnerAPI.describeSobjects() returns inconsistent results for some custom tables.

I have found a SFDC Instance where the following two calls give a different list fields for table abc_c.

DescribeSObjectResult rr[] = partnerAPI.describeSObjects( new String[] { "abc__c" });
DescribeSObjectResult rr[] = partnerAPI.describeSObjects( new String[] { "abc__c", "def__c" });

The answer is correct when a single object is described but sometimes contains phantom fields (LastViewedDate and LastReferencedDate are the two examples)  when multiple objects are described in a single call. 

Naturally I have an short application (in an eclipse project) that demonstrates the problem.  Getting a response from standard SFDC support is a different issue.  I have seen this issue once before, around a year ago, from a client in South Africa. They had premier support and after a few weeks SFDC fixed the issue. My current client does not have premier and SFDC's response is the basic "post it to the forums and maybe development will see it"

I've done a lot of java API SFDC work (3 are commercial products -- CopyStorm, CopyStorm/Restore, and SQLForce) and absolutely sure that the API is returning inconsistent field lists.
ShashankShashank (Salesforce Developers) 
Hi,

I tested this using the SoapUI tool and the LastViewedDate and LastReferencedDate fields are included in both the cases, when only one object is described and also when two objects are described. Is that not what you see?

Thanks,
Shashank
gsmithfarmergsmithfarmer
I am not surprised that you had trouble reproducing the issue because the problem does not occur in general. It is occurring at one of my customer's sites (they are happy to grant access to their org) and appears only to occur in a few tables installed by one of the larger AppExchange packages. I saw the same problem around 18 months ago on an instance in South Africa and it took a while for SFDC to track it down and fix it. The work-around for my customer is to grab DescribeSObjectResults one SObject at a time (not ideal since it eats a lot more transactions). The test harness I built to isolate the problem fetches all SObjects one at a time and also fetches them in blocks. After the fetch it compares the field lists and look for inconsistencies. Fields that are in an Sobject fetched in a batch and not in the corresponding SObject fetched as a singleton are the phantoms -- they are always LastViewedDate and LastReferencedDate. We deals with many many SFDC instances and virtually each SObject in each instance. This particular customer's instance appears to be an outlier. I would be happy to give you the test harness (it is in Java and small) and connect you with the SDFC customer. It takes 30 seconds to demonstrate the problem. This issue, https://developer.salesforce.com/forums/ForumsMain?id=906F0000000AutiIAC, gives a more detailed explanation.
gsmithfarmergsmithfarmer
This morning we saw the same problem grabbing DescribeSObjectResults for an Sobject in the InvoiceIt package (on a different customer instance).  Grabbing multiple results returns the same two phantom columns.....Grabbing 1 at a time does not.