You need to sign in to do that
Don't have an account?

EXCEEDED_MAX_TYPES_LIMIT
Hi
I trapped the above error when doing a particularly large call to describeSObjects
DescribeObjectResult[] AllObjectsDescribed =
binding.describeSObjects(String[] of all ObjectNames)
binding.describeSObjects(String[] of all ObjectNames)
- I admit a rare case but not one I have found before
C# Partner API V 6.0
I guess this has been thrown due to the resulting size of the SOAP message (?)
I guess this has been thrown due to the resulting size of the SOAP message (?)
What is the Limit and how can I determine it at run-time. The alternative of querying each object individually is a bit slow and I want to avoid an arbitary batch size.
Any thoughts gratefully received.
Thanks
Gareth.
Message Edited by Gareth Davies on 03-03-2006 03:28 PM
Thanks Simon - You answered before I'd finished getting the formatting of the message straight!
Cheers
Gareth.
Though I am calling the describeSObjects repeatetively (with different sets of Object Names), I am not able to describe more than 100 objects. Any hints, please?
Thanks
Ramana Maddikunta
I am trying something like this, but I still get only 100 objects:
Document objectsRootDoc = new Document(new Element(XMLTags.XE_OBJECTS));
int MAX_TYPES_LIMIT = 100;
DescribeGlobalResult describeGlobalResult = binding.describeGlobal();
String[] sObjectType = describeGlobalResult.getTypes();
int noOfObjToDescribe = sObjectType.length;
boolean repeatRetrieval = true;
int startIndex = 0;
String[] curObjs = null;
do
{
if(noOfObjToDescribe > MAX_TYPES_LIMIT)
{
repeatRetrieval = true;
curObjs = new String[MAX_TYPES_LIMIT];
for(int ind = startIndex, curInd=0; ind < MAX_TYPES_LIMIT; ind++, curInd++)
{
curObjs[curInd] = sObjectType[ind];
}
noOfObjToDescribe -= MAX_TYPES_LIMIT;
startIndex += MAX_TYPES_LIMIT;
}
else
{
repeatRetrieval = false;
curObjs = new String[noOfObjToDescribe];
for(int ind = startIndex, curInd=0; ind < noOfObjToDescribe; ind++, curInd++)
{
curObjs[curInd] = sObjectType[ind];
}
}
DescribeSObjectResult[] sObjectResults = binding.describeSObjects(curObjs);
DescribeSObjectResult sObjResult = null;
com.sforce.soap.partner.Field[] fields = null;
com.sforce.soap.partner.Field field = null;
if(sObjectResults != null)
{
for(int objInd=0; objInd < sObjectResults.length; objInd++)
{
sObjResult = sObjectResults[objInd];
String objName = sObjResult.getName();
Element objectEle = new Element(XMLTags.XE_OBJECT).addContent(new Element(XMLTags.XE_OBJECT_NAME).setText(objName));
objectsRootDoc.getRootElement().addContent(objectEle);
Element fieldsEle = new Element(XMLTags.XE_FIELDS);
objectEle.addContent(fieldsEle);
fields = sObjResult.getFields();
if (fields != null)
{
//
// Iterate through the fields to get properties for each field.
//
for (int fldInd = 0; fldInd < fields.length; fldInd++)
{
field = fields[fldInd];
String fieldName = field.getName();
String externalId = "false";
String fieldType = field.getType().getValue();
if(field.getExternalId() != null)
{
externalId = field.getExternalId().toString();
}
String relationshipName = "";
if(field.getRelationshipName() != null)
{
relationshipName = field.getRelationshipName();
}
fieldsEle.addContent(new Element(XMLTags.XE_FIELD)
.addContent(new Element(XMLTags.XE_FIELD_NAME)
.setText(fieldName))
.addContent(new Element(XMLTags.XE_IS_EXTERNAL_ID)
.setText(externalId))
.addContent(new Element(XMLTags.XE_RELATIONSHIP_NAME)
.setText(relationshipName)));
field = null;
}
}
fields = null;
sObjResult = null;
}
}
}while(repeatRetrieval);