You need to sign in to do that
Don't have an account?

Create Asset hierarchy in single REST API call - Parent and child assets
Hi all,
I would like to create Asset hierachy with a single REST API call, providing root Asset and his child Assets (https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_composite_sobject_tree_create.htm)
I can't do this because it seems that Asset.ParentId field doesn't have relationship name

I tried to guess relationship name but with no success.
Here is my sample request body:
Do you have any idea how this can be achieved?
I would like to create Asset hierachy with a single REST API call, providing root Asset and his child Assets (https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_composite_sobject_tree_create.htm)
I can't do this because it seems that Asset.ParentId field doesn't have relationship name
I tried to guess relationship name but with no success.
Here is my sample request body:
{ "records": [{ "attributes": {"type": "Asset"}, "Name": "Site Nested", "AccountId": "someId", "ChildAssets": { "records": [{ "attributes": {"type": "Asset"}, "Name": "Device Nested 1", "AccountId": "someId" },{ "attributes": {"type": "Asset"}, "Name": "Device Nested 2", "AccountId": "someId" }] } }] }
Do you have any idea how this can be achieved?

Is there any option besides creating new custom field and using it in REST api call to build hierarchy?
You might consider creating a map of parents with children first, then making that your output
@line 25 should be 'accId', not 'acid'.