• bz880
  • NEWBIE
  • 0 Points
  • Member since 2005

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 8
    Replies
I've been playing around the SalesForce dependent picklist functionality. It's pretty cool stuff. Can I minic this using the Ajax toolkit?

Thanks
Baldwin
  • February 23, 2006
  • Like
  • 0
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;
};


  • February 06, 2006
  • Like
  • 0
I'm looking at the DescribeSObject call and it's relation to the Ajax toolkit. In my use case, I want to use the DescribeSObject to see if the Opportunity is createable. When I use the Ajax toolkit and call DescribeSObject, the response xml contains an element as such.

true.

However, when I access this field from javascript, as such
var objDesc = sforceClient.DescribeSObject("Opportunity");
alert(objDesc.createable)
it will always return false.

To further validate my point, when I use the SForce Explorer and describe Opportunity, the createable will always equal false for the Opportunity Object.

Has anyone seen anything like this before? Is there a workaround?

Thanks
Baldwin
  • February 03, 2006
  • Like
  • 0
Using the AJAX api, is there a way to identify if a field has been deprecated. I waded through the javascript source and cannot find any reference.

Baldwin
  • December 21, 2005
  • Like
  • 0
Hi there,

I was trying to update some opportunity line item fields with a value of 0.00. This works no problem through the standard SalesForce edit screen. However, when this opportunity is retrieved through the AJAX API, no values are being returned to me.

Has anyone else dealt with something like that?

Thanks
Baldwin
  • December 12, 2005
  • Like
  • 0
Has anyone been experiencing the following SOAP fault?

org.xml.sax.SAXParseException: The entity name must immediately follow the '&' in the entity reference. faultcode: soapenv:Server

I've been using the AJAX toolkit and some of my updates have this error.

Thanks
  • December 01, 2005
  • Like
  • 0
I'm looking at the DescribeSObject call and it's relation to the Ajax toolkit. In my use case, I want to use the DescribeSObject to see if the Opportunity is createable. When I use the Ajax toolkit and call DescribeSObject, the response xml contains an element as such.

true.

However, when I access this field from javascript, as such
var objDesc = sforceClient.DescribeSObject("Opportunity");
alert(objDesc.createable)
it will always return false.

To further validate my point, when I use the SForce Explorer and describe Opportunity, the createable will always equal false for the Opportunity Object.

Has anyone seen anything like this before? Is there a workaround?

Thanks
Baldwin
  • February 03, 2006
  • Like
  • 0
Using the AJAX api, is there a way to identify if a field has been deprecated. I waded through the javascript source and cannot find any reference.

Baldwin
  • December 21, 2005
  • Like
  • 0
Hi there,

I was trying to update some opportunity line item fields with a value of 0.00. This works no problem through the standard SalesForce edit screen. However, when this opportunity is retrieved through the AJAX API, no values are being returned to me.

Has anyone else dealt with something like that?

Thanks
Baldwin
  • December 12, 2005
  • Like
  • 0
Has anyone been experiencing the following SOAP fault?

org.xml.sax.SAXParseException: The entity name must immediately follow the '&' in the entity reference. faultcode: soapenv:Server

I've been using the AJAX toolkit and some of my updates have this error.

Thanks
  • December 01, 2005
  • Like
  • 0