I would like to create Asset hierachy with a single REST API call, providing root Asset and his child Assets (Documentation).
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", "referenceId" : "root"},
"Name": "Root Device",
"AccountId": "someId",
"ChildAssets": {
"records": [{
"attributes": {"type": "Asset", "referenceId" : "device1"},
"Name": "Device Nested 1",
"AccountId": "someId"
},{
"attributes": {"type": "Asset", "referenceId" : "device2"},
"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?
Asset
and examine thegetChildRelationships()
- the relationship to child asset displays with name = null; same when using Eclipse Schema explorer. You may have to use an external ID to make the association or multiple REST calls. I tried guessing as did you that the relationship name followed SFDC conventions and was simplyChildAssets
orAssets
- but that was an invalid type. I don't think SFDC as of V36 is exposing this relationship name yet.