
Announcements
Hi,
I'm using custom api with one parameter in type of EntityCollection and for lookup I'm using EntityReference with usage of alternate key.
example json payload
{
"collection": [
{
"@odata.type": "Microsoft.Dynamics.CRM.new_itemtable",
"new_reftableid": {
"@odata.type": "Microsoft.Dynamics.CRM.new_reftable",
"new_itemid": "key123"//alternatekey
},
}
],
"reftable": {
"@odata.type": "Microsoft.Dynamics.CRM.new_reftable",
"new_itemid": "key123"
}
}And from plugin reftable parameter is working (EntityReference, new_reftable)
Collection attribute "collection" that entityreference attribute is not present.
And if I use SDK in C# (Microsoft.PowerPlatform.Dataverse.Client) it's working
EntityCollection collection = new EntityCollection(); collection.Entities.Add(new Entity("new_itemtable") { ["new_reftableid"] = new EntityReference("new_reftable", "new_itemid", "key123"), ["new_otherfield"] = 10, }); OrganizationRequest request = new OrganizationRequest("gas_createdeliveryorder") { Parameters = { ["deliveryorderlines"] = collection, ["reftable"] = new EntityReference("new_reftable", "new_itemid", "key123"), } }; var response = client.Execute(request);
And sdk is working on plugin I get value for "collection.new_reftableid
Any idea what's wrong in my http request body that this collection item not working?
I found out that missing data are present in Entity.RelatedEntities.
Still, it's strange that message from SDK (this always is old soap message, even if I use UseWebapi =true), it's getting those data inside of Entity no need to check for RelatedEntities