Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Salesforce by (11.9k points)

I am attempting to create a new Case object using the REST API but need to find out how to format the JSON body to pass in nested SObjects.

It's not apparent in the Docs, and I can't seem to find any examples. Anyone have any pointers or have done this before?

The SF web UI uses a text lookup field to set the (related) Contact and Account, and I need to figure out how to either bypass the need for a lookup or embed the SObjects of the related records in the JSON.

[{"message":"The value provided for foreign key reference Contact is not a nested SObject","errorCode":"INVALID_FIELD"}]

1 Answer

0 votes
by (32.1k points)
Hey, you can fix simply fix this by setting the AccoubtId and ContactId attributes on the new Case object.

Related questions

Browse Categories

...