locked
Inserting a record in to a N:N relationship RRS feed

  • Question

  •  

    Hi,

     

    I have created a N:N relationship between two customer entities, say called A and B.

     

    I am using the CRM 4 SDK and trying to create a plugin.

     

    In order to create a new record in each I have been inserting one record in A, then the necessary record in B. The N:N relationship obviously creates a link table in the database so using the Ids of the records just inserted in A and B I have been trying to insert the relative link record in to the N:N relationship table, using the SDK of course.

     

    However, this fails with a general Soap Exception....

     

    Is there something I am missing?

     

    Cheers,

     

    John

    Thursday, August 28, 2008 2:09 PM

Answers

  • What kind of object have you been used to create the N:N relationship?  To create the N:N relationship, you need to create an instance of the  AssociateEntitiesRequest  class and specify the Moniker1 and Moniker2.

    Thursday, August 28, 2008 2:30 PM

All replies

  • What kind of object have you been used to create the N:N relationship?  To create the N:N relationship, you need to create an instance of the  AssociateEntitiesRequest  class and specify the Moniker1 and Moniker2.

    Thursday, August 28, 2008 2:30 PM
  • Thanks for that, I will give it a go. All the entities involved are custom entities and I have been using the CreateRequest(..) object.

     

    Thursday, August 28, 2008 2:46 PM
  • Worked a treat, thank you very much for your help!

     

    Thursday, August 28, 2008 2:59 PM
  • Hi,

    I am using crm 2011 and trying to insert the record in N:N relationship link table by using organisationserviceproxy.Create(entity). But its throwing exeception "The 'Create' method does not support entities of type "table".

    Also, I saw that retrievemultiple is working on this table.

     

    Thanks,

    Birva


    • Edited by Birva Wednesday, October 12, 2011 12:34 PM
    Wednesday, October 12, 2011 12:32 PM