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
bz880bz880 

Having trouble with DescribeSObjects function

I am trying to use the DescribeSObjects function from the Ajax Version 2 toolkit.

The function DescribeSObjects takes a parameter objectTypes, but in the internalCallback inner function, the describeCache statement is making reference to objectType. This causes a javascript error when executed.

Further, from the Enterprise WSDL, the payload should be sending an array of . I don't see code in the DescribeSObjects function that serializes the objectTypes into an array of .

Has anyone successfully deserialized the DescribeSObjects call in AJAX?

Here is the code for the function DescribeSObjects

SforceClient.prototype.DescribeSObjects = function(objectTypes, callback) {
var sfClient = this;
var returnValue;
internalCallback = function(req) {
returnValue = _createSforceObject(req); //sfClient._describeSObjectHandler(req);
if (dltypeof(returnValue) != "SoapFault") {
describeCache[objectType.toLowerCase()] = returnValue;
}
if (callback) callback(returnValue);
}
//if (describeCache[objectType.toLowerCase()] == null) {
makeDescribeSObjectsRequest = function(objectType) { return buildRequest("" + objectTypes + "");};
var as = true;
if (callback == undefined) as = false;
this.SendRequest2(makeDescribeSObjectsRequest(objectTypes), internalCallback, "describe", as, this.getServerUrl());
//} else {
// returnValue = describeCache[objectType.toLowerCase()];
if (callback) callback(returnValue);
//}
return returnValue;
};


Ron HessRon Hess
current ajax version is 3.3, DevAngel just posted a clean , short sample which includes the 3.3 lib in another thread on sorting

Remember, the toolkit uses (only) the partner WSDL, not enterprise WSDL

if you find that the 3.3 version doesn't work, please post, i've not tried this call.
SteveBowerSteveBower
Just fyi, I was also unable to get DescribeSObjects to work properly, I didn't try to debug it, but just went back to the deprecated DescribeSObject (singular) usage.
-Steve.

P.S. I'll make a deal... if someone will look at my Documents problem posted in "general", I'll look at this a bit more! :-)