Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Updating Native N:N entity (system Entity)

Posted on by 235

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

  • Suggested answer
    Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Updating Native N:N entity (system Entity)

    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.

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: Updating Native N:N entity (system Entity)

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans