You need to sign in to do that
Don't have an account?
Alister Rollins
Error on upsert/create Junction object via API
Hi, I'm having trouble creating or upserting a junction object via the API, the object is custom.
The problem seems to be restricted to junction objects (when it has 2 Master-detail relationships in it), because any other type of custom object works perfectly fine.
Here's a successful XML request :
<soap:Body>
<sforce:upsert xmlns:sforce="urn:partner.soap.sforce.com" xmlns:sfons="urn:sobject.partner.soap.sforce.com">
<sforce:externalIDFieldName xsi:type="xsd:string">ID</sforce:externalIDFieldName>
<sObjects xsi:type="sforce:AcctAttnAssoc__c">
<sforce:AttendanceDetails__c xsi:type="xsd:string">a194000000040deAAA</sforce:AttendanceDetails__c>
<sforce:Name xsi:type="xsd:string">randomname</sforce:Name>
<sforce:Account__c xsi:type="xsd:string">0014000000rE6moAAC</sforce:Account__c>
</sObjects>
</sforce:upsert>
</soap:Body>
And here's an unsuccessful XML request:
<soap:Body>
<sforce:upsert xmlns:sforce="urn:partner.soap.sforce.com" xmlns:sfons="urn:sobject.partner.soap.sforce.com">
<sforce:externalIDFieldName xsi:type="xsd:string">ID</sforce:externalIDFieldName>
<sObjects xsi:type="sforce:Attendance_Log__c">
<sforce:Attendance__c xsi:type="xsd:string">a1340000008DlmxAAC</sforce:Attendance__c>
<sforce:Name xsi:type="xsd:string">randomname</sforce:Name>
<sforce:Account__c xsi:type="xsd:string">0014000000rE6moAAC</sforce:Account__c>
</sObjects>
</sforce:upsert>
</soap:Body>
As mentioned before, the only difference is that AcctAttnAssoc__c has 2 Master-detail relationships in it (Attendance__c & Account__c).
The error I get back is:
Fatal error: INVALID_TYPE: sObject type 'AcctAttnAssoc__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.
Please let me know if you need any more details, thanks.
The problem seems to be restricted to junction objects (when it has 2 Master-detail relationships in it), because any other type of custom object works perfectly fine.
Here's a successful XML request :
<soap:Body>
<sforce:upsert xmlns:sforce="urn:partner.soap.sforce.com" xmlns:sfons="urn:sobject.partner.soap.sforce.com">
<sforce:externalIDFieldName xsi:type="xsd:string">ID</sforce:externalIDFieldName>
<sObjects xsi:type="sforce:AcctAttnAssoc__c">
<sforce:AttendanceDetails__c xsi:type="xsd:string">a194000000040deAAA</sforce:AttendanceDetails__c>
<sforce:Name xsi:type="xsd:string">randomname</sforce:Name>
<sforce:Account__c xsi:type="xsd:string">0014000000rE6moAAC</sforce:Account__c>
</sObjects>
</sforce:upsert>
</soap:Body>
And here's an unsuccessful XML request:
<soap:Body>
<sforce:upsert xmlns:sforce="urn:partner.soap.sforce.com" xmlns:sfons="urn:sobject.partner.soap.sforce.com">
<sforce:externalIDFieldName xsi:type="xsd:string">ID</sforce:externalIDFieldName>
<sObjects xsi:type="sforce:Attendance_Log__c">
<sforce:Attendance__c xsi:type="xsd:string">a1340000008DlmxAAC</sforce:Attendance__c>
<sforce:Name xsi:type="xsd:string">randomname</sforce:Name>
<sforce:Account__c xsi:type="xsd:string">0014000000rE6moAAC</sforce:Account__c>
</sObjects>
</sforce:upsert>
</soap:Body>
As mentioned before, the only difference is that AcctAttnAssoc__c has 2 Master-detail relationships in it (Attendance__c & Account__c).
The error I get back is:
Fatal error: INVALID_TYPE: sObject type 'AcctAttnAssoc__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.
Please let me know if you need any more details, thanks.
The API version used needs to be 13.0 or above to handle junction objects.