You need to sign in to do that
Don't have an account?
bz880
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
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;
};
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.
-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! :-)