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
Gareth DaviesGareth Davies 

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)
 

 
- 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 (?)
 

 
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

SuperfellSuperfell
You can't pass more than 100 types to describeSObjects in a single call, this should be in the docs, its also in the wsdl (the array has a maxOccurs='100' attribute on it)
Gareth DaviesGareth Davies

Thanks Simon - You answered before I'd finished getting the formatting of the message straight!

Cheers

Gareth.

RamanaRamana
Hello Simon,

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
SuperfellSuperfell
you can only pass 100 types to describeSObjects at once, so if you need to describe more than that, you need to break them up into 100 chunks.
RamanaRamana

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);