You may get this error related if you are replicating a record to Salesforce and your record includes a reference field to another table. For example, if you have a Case record and are referencing the Account field, your JSON may look like this:
{"Subject":"Test""Id":"00000000000001","Description":"Test","attributes":{"type":"Case"},
"Account":"20000000000002"} |
And you may get this error:
The value provided for foreign key reference Account is not a nested SObject |
In this case, because your reference field (Account) is referencing another table and you're passing the Id value of a record into that table, you would want to use the field name with “Id” appended to the end, i.e. AccountId, like so:
{"Subject":"Test","Id":"00000000000001","Description":"Test","attributes":{"type":"Case"},
"AccountId":"20000000000002"} |
Custom fieldsAnd what about for custom fields? Set the Id value to the API Name of the field - it will need to use the 18 character (not 15) Id value. For example:
|