locked
CRM 2011 on-premises - How to retrieve list of system and custom many to many relationships? RRS feed

  • Question

  • Hello Everyone,

    I would like to generate the list of custom and system many to many relationships of our CRM system in a separate .Net program.

    I reviewed the following add-in but it was not provide the expected results.

    http://crm2011manytomanyrel.codeplex.com/

    Dose anyone know which SDK messages can be used to fetch the required list? Or is there any other ready made tool that helps me to get list of custom and system many to many relationships?


    Thanks, Ankit Shah


    Inkey Solutions, India.
    Microsoft Certified Business Management Solutions Professionals
    http://www.inkeysolutions.com/MicrosoftDynamicsCRM.html


    Wednesday, November 13, 2013 5:48 AM

Answers

  • I received the following answer from another forum and it worked.

    "The difficult workaround is to use the RetrieveAllEntityRequest and get the list of entities and then iterate over the EntityMetaData. In EntityMetaData there is an attribute called CanBeInManyToMany if this is true thenuse the property of ManyToManyRelationShipMetaData property this gives you an array of ManyToManyRelationShip for that entity. To get the more details about this specific relationship you can use the RetrieveRelationShipRequest call. Refer to the SDK sample code found at the following location in the SDK >>>>>>> SampleCode\CS\Metadata\Relationships\DumpRelationships.cs"


    Thanks, Ankit Shah


    Inkey Solutions, India.
    Microsoft Certified Business Management Solutions Professionals
    http://www.inkeysolutions.com/MicrosoftDynamicsCRM.html

    Wednesday, November 13, 2013 2:37 PM

All replies

  • Hi Ankit,

    Did you try to use RetrieveAllEntitiesRequest and passing filter as relationship ??


    Our Website | Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Wednesday, November 13, 2013 8:03 AM
    Moderator
  • I received the following answer from another forum and it worked.

    "The difficult workaround is to use the RetrieveAllEntityRequest and get the list of entities and then iterate over the EntityMetaData. In EntityMetaData there is an attribute called CanBeInManyToMany if this is true thenuse the property of ManyToManyRelationShipMetaData property this gives you an array of ManyToManyRelationShip for that entity. To get the more details about this specific relationship you can use the RetrieveRelationShipRequest call. Refer to the SDK sample code found at the following location in the SDK >>>>>>> SampleCode\CS\Metadata\Relationships\DumpRelationships.cs"


    Thanks, Ankit Shah


    Inkey Solutions, India.
    Microsoft Certified Business Management Solutions Professionals
    http://www.inkeysolutions.com/MicrosoftDynamicsCRM.html

    Wednesday, November 13, 2013 2:37 PM