XrmDefinitelyTyped
XrmDefinitelyTyped copied to clipboard
XrmQuery.create with associated entity
Is there a way to create associated entities at the same time as the primary entity? This is possible through normal WebApi - e.g.
{
"name": "Sample Account",
"opportunity_customer_accounts":
[
{
"name": "Opportunity associated to Sample Account",
"Opportunity_Tasks":
[
{ "subject": "Task associated to opportunity" }
]
}
]
}
What does the corresponding call look like in XrmQuery? I have tried using the 'xxxResult' interface, but a) that requires specifying fields like odata.etag, createdby_guid, etc. and b) it throws an error. Am I missing something, or is there a missing piece of functionality here?
It was definitely meant to work, but there seems to be an error. XDT tries to reuse as many types as possible, but it seems that two intentions with the same type has clashed. The fix is to look at other parts that use xxx_Result and figure out whether those should get a new type, or if the required fields on the xxx_Result type are actually necessary. If they're not necessary, they can be made optional by adding ? to the attribute in xxx_Result.