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
SaurabhRawaneSaurabhRawane 

INVALID_TYPE:all sObjects in create or update must be of same type ERROR

   Hi All,

   I am using partner wsdl,in my java program i am forming two SObject Arrays one for upsert and other for update.And i am making a upsert and update call using these two SObject.Following is the Error message that i am getting

INVALID_TYPE:all sObjects in create or update must be of same type ERROR---for upsert


INVALID_TYPE:sObject type 'sObject' 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.----for update.

Kindly help me into this.

Thanks,
Saurabh

SuperfellSuperfell
The first one is as it says, all the objects passed in a single call must be of the same type (i.e. all accounts, all contacts etc).

The 2nd one sounds like you're using the partner WSDL, but making your request against the enterprise API endpoint URL.
SaurabhRawaneSaurabhRawane
Thanks a lot Simon for your quick help,I was able to resolve the issue and the reason behind the problem was something interesting,

While making an UPSERT call we pass the method with the parameter as SOject array,suppose the size of that array is five,but if we have only four elements in that array and if any element is null in that array we will be getting that error,now I ensured that the SObject array is completely filled with all the Elements I was not getting the Error,sounding very interesting for me...as i havent encountered such a situation before..