I am getting the error, "Association cannot be performed between an entity of type campaign and an entity of type list." when I try to use Dynamics CRM Online Web API to make a connection between a Campaign and a Marketing List.
I am using V9.0 of the api
Approach 1: deep insert
POST: {{webapiurl}}campaigns
Body:
{
"name": "test 2",
"campaignlist_association": [
{
"listname":"test3",
"createdfromcode":2
}
]
}
Response: {
"error": { "code": "0x80040203",
"message": "Association cannot be performed between an entity of type campaign and an entity of type list.", "innererror": { "message": "Association cannot be performed between an entity of type campaign and an entity of type list.", "type": "Microsoft.Dynamics.Solution.Common.CrmNotSupportedException", } } }
Approach 2: Association POST: …/campaigns(000000000xxxxxx)/campaignlist_association/$ref
Body:
{
"@odata.id":"{{webapiurl}}/lists(11111111xxxxxxxx)"
}
Response:
{ "error": { "code": "0x80040203",
"message": "Association cannot be performed between an entity of type campaign and an entity of type list.",
"innererror": { "message": "Association cannot be performed between an entity of type campaign and an entity of type list.", "type": "Microsoft.Dynamics.Solution.Common.CrmNotSupportedException", } } }
Results Both approaches yield the same error message: "Association cannot be performed between an entity of type campaign and an entity of type list." However, when if I relate them in the Dynamics CRM UI, and query campaigns I accurately see the list assigned to the campaign if I expand the "campaignlist_association" property via the web api.