Hi,
Is it possible to use alternate key on custom api when input parameter is type of Entity Reference. Then in payload to custom api call instead of entity reference in form of table name and record id use, alternate key from source table.
example payload:
{
"contactid": {
"@odata.type": "Microsoft.Dynamics.CRM.contact",
"customalternatekey" : "uniquevalue01"
}
}
C# example call:
EntityReference contactIdKey= new EntityReference("contact", "customalternatekey", "uniquevalue01");
OrganizationRequest request = new OrganizationRequest("new_apitest")
{
Parameters =
{
["contactid"] = contactIdKey,
}
};
var response = client.Execute(request);