Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.

sObject Tree Response Body

Describes the result of an sObject Tree request.

Properties

Name Type Description
hasErrors Boolean true if an error occurred while creating a record; false otherwise.
results Collection Upon success, results contains the reference ID of each requested record and its new record ID. Upon failure, it contains only the reference ID of the record that caused the error, error status code, error message, and fields related to the error. In the case of duplicate reference IDs, results contains one item for each instance of the duplicate ID.

JSON example upon success

1{
2    "hasErrors" : false,
3    "results" : [{
4     "referenceId" : "ref1",
5     "id" : "001D000000K0fXOIAZ"
6     },{
7     "referenceId" : "ref4",
8     "id" : "001D000000K0fXPIAZ"
9     },{
10     "referenceId" : "ref2",
11     "id" : "003D000000QV9n2IAD"
12     },{
13     "referenceId" : "ref3",
14     "id" : "003D000000QV9n3IAD"
15     }]
16}

XML example upon success

1<?xml version="1.0" encoding="UTF-8"?>
2<SObjectTreeResponse>
3    <hasErrors>false</hasErrors>
4    <results>
5        <id>001D000000K0fXOIAZ</id>
6        <referenceId>ref1</referenceId>
7    </results>
8    <results>
9        <id>001D000000K0fXPIAZ</id>
10        <referenceId>ref4</referenceId>
11    </results>
12    <results>
13        <id>003D000000QV9n2IAD</id>
14        <referenceId>ref2</referenceId>
15    </results>
16    <results>
17        <id>003D000000QV9n3IAD</id>
18        <referenceId>ref3</referenceId>
19    </results>
20</SObjectTreeResponse>

JSON example upon failure

1{
2   "hasErrors" : true,
3   "results" : [{
4     "referenceId" : "ref2",
5     "errors" : [{
6       "statusCode" : "INVALID_EMAIL_ADDRESS",
7       "message" : "Email: invalid email address: 123",
8       "fields" : [ "Email" ]
9       }]
10     }]
11}

XML example upon failure

1<SObjectTreeResponse>
2    <hasErrors>true</hasErrors>
3    <results>
4        <errors>
5            <fields>Email</fields>
6            <message>Email: invalid email address: 123</message>
7            <statusCode>INVALID_EMAIL_ADDRESS</statusCode>
8        </errors>
9        <referenceId>ref2</referenceId>
10    </results>
11</SObjectTreeResponse>