How to import data for many to many relationships?

Version 2

    Details

    When we want to link objects in two different tables with a many to many relationship we use what we call the FusionLink table. However, this table does not allow us to do a bulk import from an external file like Excel or XML, if this functionality is needed, this kind of relationship would limit our options.  This article demonstrates how to create in an alternate way a many to many relationship using a new "link" table. In this case we chose to link any CI object to any CI.EnterpriseApplication objects, but this example could be useful for any similar combination.


    Resolution

    1.- Create a new Stand-alone Business Object



    Name it CILinkedEnterpriseApplication



    2.- Create a Link field for the CI (the relationship will be defined once created)



    3.- Create a Link field for the CI.EnterpriseApplication (the relationship will be defined once created)



    4.- Create a relationship to the CI object using the CILink field



    5.-  Create a relationship to the CI.EnterpriseApplication object using the CIEnterpriseApplicationLink field



    6.- Modify both link fields using the relationships created





    7.- Add a new form including both Link fields



    Configure the CI field as in the screenshot



    Configure the EnterpriseApplication as in the screenshot



    8.- Create a grid including the name of the CI.EnterpriseApplication, using the relationship option on the left. Then rename the title to "Enterprise Application"



    9.- In the Details tab, modify the Default form



    10.- From this step I will work with CI.VirtualWorkstation, but it would be similar with other CI objects like Computers, Servers, VirtualServers, etc.
    Open the CI layouts and select the one that you work with, in my case will be CI. In the "Views in this layout" list, select the formView that you want to modify, in this case VirtualWorkstation



    11.- In the bottom of this page, add a new Child Panel and select as Direct Relationship "CILinkedEnterpriseApplicationAssocCI"



    Configure the form and the grid created in the previous steps.



    Edit the toolbar as in the screenshot



    12.- Opening a VirtualWorkstation, the following tab should be available



    13.- Test it creating some records record:





    After completing all these steps, you can do a bulk import from an Excel file into this new table CILinkedEnterpriseApplication and you will see the values in this tab.