locked
Many to one relationship between activity and custom entity pair does not work (Letter <- Foo -> Bar) RRS feed

  • Question

  • Given
    a custom entity 'Foo' with a one-to-many relationship to 'Letter' (denoted as Foo -> Letter)

    When
    I export Foo and Letter, and import them

    Observation
    everything works just fine

    Now let's complicate things:

    Given
    a custom entity 'Foo'
    a custom one-to-many relationship from Foo to 'Letter' ( Foo -r> Letter)
    a custom entity 'Bar'
    a one to many referential relationship between Foo and Bar (Foo -r> Bar)

    When
    I export Foo, Bar, and Letter, and import them

    Observation
    The import fails, reporting "failure: new_new_foo_new_bar : invalid argument

    When
    I import Foo

    Observation
    The import succeeds

    When
    I import Foo and Letter

    Observation
    The import succeeds

    ---------

    The (Letter <r- Foo -r> Bar) relationships where my attempt to establish a many to many relationship between letter and the bar ( Letter <-->Bar) , but that is not directly supported by the Microsoft CRM 4.0 platform. Our current platform at Microsoft CRM 4.0 without any roll ups. Is this issue fixed in one of the roll ups? Or is it a "feature?"


    Best Regards, David K Allen Minneapolis, Minnesota, USA
    Friday, August 7, 2009 9:16 PM

Answers

  • Hi David,

    I faced this issue long time ago while customizations and deployment.

    Try this out:
    When you have a '1 to many' or 'many to 1' relationship between 2 entities, publish both the entities involved in the relationship together. Now try to export and import it into another machine.

    Observations: The problem that I noticed after self research was, when we create a relationship between 2 entities, the secondary entity will have a lookup to the primary entity. Failing to publish the entity that has a lookup will have an issue with the exported XML file (especially with that lookup field). It will have a slightly different representation than the published lookup fields.

    Bottom Line: Try to publish the entity that has the lookup field to the primary entity. As a best practice, publish both the entities in relation.

    Hope this helps!!
    Best Regards,
    Gagandeep Singh
    http://mscrmnovice.blogspot.com
    Saturday, August 8, 2009 1:20 AM

All replies

  • Hi David,

    I faced this issue long time ago while customizations and deployment.

    Try this out:
    When you have a '1 to many' or 'many to 1' relationship between 2 entities, publish both the entities involved in the relationship together. Now try to export and import it into another machine.

    Observations: The problem that I noticed after self research was, when we create a relationship between 2 entities, the secondary entity will have a lookup to the primary entity. Failing to publish the entity that has a lookup will have an issue with the exported XML file (especially with that lookup field). It will have a slightly different representation than the published lookup fields.

    Bottom Line: Try to publish the entity that has the lookup field to the primary entity. As a best practice, publish both the entities in relation.

    Hope this helps!!
    Best Regards,
    Gagandeep Singh
    http://mscrmnovice.blogspot.com
    Saturday, August 8, 2009 1:20 AM
  • That worked.
    thanks very much
    Best Regards, David K Allen Minneapolis, Minnesota, USA
    Saturday, August 8, 2009 9:20 PM
  • OH, I forgot to mention that publishing them together was not enough. I had to export them together. In fact, I had to export the System Entity (Letter) and the two custom entities A and B.   This surprised me because the export clearly warns you that you must export all custom entities together but it suggests that relationships to system entities are carried along in any situation. But this appears to be untrue.  During export, I needed to include the system entity that participates in the relationship as well as the custom entities. THis implies that we will need to export all our entities (both custom and customizable) in one large package for reliable deployment.

    What is your practice around the export and deployment? Do you export all customizations? Or all cusotm and customizable entities? or what?
    Best Regards, David K Allen Minneapolis, Minnesota, USA
    Saturday, August 8, 2009 10:13 PM
  • Hi David,

    I'm glad it did.

    Note: While you are exporting the customizations, your other custom settings such as security roles, templates and workflows are also included. Be sure you include them when you are selective.

    It would be a good practice to export all the customizations, but while importing you may or may not want to be selective.

    Best Regards,
    Gagandeep Singh
    http://mscrmnovice.blogspot.com
    Sunday, August 9, 2009 4:33 PM