Following scenario:
An entity has a required Contact field. During creation of new items this value should be used for a new connection role.
Flow (last step fails):
> Trigger on item creation
> Initialize variable as string for Role-Id
> Get all Connection Roles
> Find the right role and store ID in variable initialized before
> Create a new Connection record with ID variable set for "Role (from)" "Role (to)"
Issue:
Something seems to be missing and I receive following error if I try to create a new entity Connection:
There are no ConnectionRoleId and AssociatedObjectTypeCode pairs present.
I think I have set all relevant and available fields, but something is missing I guess.
Any help is really appreciated here.
Inputs:
{
"host": {
"apiId": "subscriptions/[SUBSCRIPTION-ID]/providers/Microsoft.Web/locations/westeurope/runtimes/europe-001/apis/commondataservice",
"connectionReferenceName": "shared_commondataservice",
"operationId": "PostItem_V2"
},
"parameters": {
"dataset": "default.cds",
"table": "connections",
"item/statuscode": 1,
"item/_ownerid_type": "",
"item/_record2roleid_value": "[ROLE-ID]",
"item/_record1roleid_value": "[ROLE-ID]",
"item/_record2id_value": "[CONTACT-ID]",
"item/_record2id_type": "contacts",
"item/_record1id_value": "[ENTITY-ID]",
"item/_record1id_type": "[CUSTOM-ENTITY-TYPE]"
}
}
Outputs:
{
"statusCode": 400,
"headers": {
"Pragma": "no-cache",
"x-ms-request-id": "***",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"X-Content-Type-Options": "nosniff",
"X-Frame-Options": "DENY",
"Timing-Allow-Origin": "*",
"x-ms-apihub-cached-response": "false",
"Cache-Control": "no-store, no-cache",
"Date": "Tue, 01 Oct 2019 13:29:38 GMT",
"Set-Cookie": "ARRAffinity=****;Path=/;HttpOnly;Domain=commondataservice-we.azconn-we.p.azurewebsites.net",
"Content-Length": "504",
"Content-Type": "application/json",
"Expires": "-1"
},
"body": {
"status": 400,
"message": "There are no ConnectionRoleId and AssociatedObjectTypeCode pairs present. Entities being connected: ([CUSTOM-ENTITY-TYPE],contact); Entity Records being connected: (null,null); Record1ConnectionRoleName: null, Record2ConnectionRoleName: null. ConnectionRoleIds: [ROLE-ID], [ROLE-ID];",
"source": "***.crm4.dynamics.com",
"errors": [],
"debugInfo": "clientRequestId: ***"
}
}