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
Joe ZaloomJoe Zaloom 

Error creating custom object: INVALID_TYPE: sObject type '[Object Name]' is not supported

We have two custom objects I'm trying to create using the partner wsdl. I am able to create the first object (isp__Chat__p) successfully. While creating the second object (isp__Mail__c), I get the following error:

INVALID_TYPE: sObject type 'Isp__Mail__c' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.

Describe Global lists both objects:

isp__Chat__c
isp__Mail__c

Describe SObject gives the same result for both objects:

Metadata for Isp__Chat__c object:

Object name                       = isp__Chat__c
Number of fields                  = 51
Object can be activated           = false
Can create rows of data           = true
Object is custom object           = true
Can delete rows of data           = true
Can query for rows of data        = true
Object can be used in replication = true
Can use retrieve method on object = true
Can use search method on object   = true
Can un-delete rows of data        = true
Can update rows of data           = true

Metadata for isp__Mail__c object:

Object name                       = isp__Mail__c
Number of fields                  = 48
Object can be activated           = false
Can create rows of data           = true
Object is custom object           = true
Can delete rows of data           = true
Can query for rows of data        = true
Object can be used in replication = true
Can use retrieve method on object = true
Can use search method on object   = true
Can un-delete rows of data        = true
Can update rows of data           = true

Here is the relevant code:

Code:
  SObject mail = new SObject();
  
  MessageElement[] elems = new MessageElement[2]; //props.PROPERTIES.size() - 1];
  
  
  elems[idx++] = this.newMessageElement("Name", props.KEY_VALUE);
  elems[idx++] = this.newMessageElement("setIsp__Account__c", props.PROPERTIES.get("sfaccount"));

  // set SObject object properties
  mail.set_any(elems);
  mail.setType("isp__Mail__c");
       
  // save
  SObject sos[]  = new SObject[1];
  sos[0]    = mail;
  
  SaveResult[] sr = null;

  logger.info("creating mail object " + props.KEY_VALUE );
    
  try {

   sr = _binding.create(sos);
   
  } catch {
  
  ...

 
I've hit the wall hard. Any help would be appreciated.

thanks,
Joe Zaloom

SuperfellSuperfell
Are you using partner access controls ?

can you show a capture of your actual soap request ?
Joe ZaloomJoe Zaloom
Thanks for the reply Simon. As I was running the app to get the SOAP request from the logs, it mysteriously worked. I haven't changed the code since I was seeing the error. I did open a support case on the issue, so maybe somebody tweaked something on the SF side? In any case, it looks like it's working now.

Thanks again for your attention to this.
Joe Zaloom