Hi
We have a custom entity Called category. We have created a N:N native relationship with Team entity (meaning one team can have more than one category and one category can be associated to more than 1 team). The system entity that was created is called new_new_category_team. Now when we try updating this entity using a ETL tool we are able to do it (Informatica Rest Connector). But when we try deleting the record from this system table we are encountering this error.
WRITER_1_*_1> MSDWrt_1073 [2018-06-27 23:24:11.575] [ERROR] Failed to delete the record of entityID: [521231238-6f7a-e811-a95a-234234234234234] from Microsoft Dynamics CRM because of the following error: [The 'Delete' method does not support entities of type 'emptech_emptech_casecategory_emptech_casequeryt'.].
Please help us resolve this
Thanks in advance
Mohan
*This post is locked for comments
In order to Add/Remove records from a many to many relationship, you need to use the Associate/Disassociate messages.
The create and delete do not work for these circumstances.
EntityReferenceCollection relatedEntities = new EntityReferenceCollection();
// This allows you to associate/disassociate multiple records at one
relatedEntities.Add(new EntityReference("team", teamId));
Relationship relationship = new Relationship("NAME_OF_RELATIONSHIP");
service.Associate("new_category", categoryId, relationship, relatedEntities);
service.Disassociate("new_category", categoryId, relationship, relatedEntities);
Hope this helps.
Hi,
you should use dissociate message in order to remove N: N relationship record.
Refer below link.
msdn.microsoft.com/.../microsoft.xrm.sdk.iorganizationservice.disassociate.aspx
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156