Create Salesforce Case object with nested relationships using REST API

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"}]

Answers


Figured it out by simply setting the AccountId and ContactId attributes on the new Case object.


Need Your Help

Text displaying on wrong line in IE

html css internet-explorer

I have some code to display a logo at the bottom of my page:

No Intellisense in views updating from ASP.NET MVC 4 to MVC 5

.net asp.net-mvc visual-studio asp.net-mvc-4 intellisense

I just updated an mvc4 project (using vs2012) to mvc5. After having a lot of issues related to dependencies, I finally found this tutorial and straightened things up so that it builds without issues