Search This Blog

Wednesday, May 28, 2014

New XrmToolBox plugin : Import/Export NN relationships

Two plugins in one day! wow!

This one was, in fact, developed a couple of months ago.

One of my colleague was using a solution from my fellow MVP Andrii Butenko which allows to import/export NN relationships in a silverlight web resource. This was nice but my colleague was using other attributes than primary key to do the mapping and Andrii’s solution does not support this.

So he asked me to develop a XrmToolBox’s plugin that could do this.

And, here it is! You can select entities and relationships and moreover, choose mapping attributes on both enitities. I only let text and number attributes selectable as other does not really make sense for mapping purposes.

Then you can import or export NN relationships!

Here is a preview

image

As usual, this plugin, among other, is available with XrmToolBox on CodePlex

14 comments:

Franck said...

Hi,

The NN relationships import/export is a really usefull tools. But I didn't find how to import reflexive relationship : there is an error : "Entity role must be specified for reflexive relationship". Is there a way to do it?

Thank you

Tanguy said...

Hi, I never tried this scenario but I will test it and adapt the tool if possible.

Franck said...

Thank you very much.
I think it's possible since it's possible in dev with :
associateRequest.Relationship.PrimaryEntityRole = EntityRole.Referenced;

Please let me know if you adapt it.

Regards

Tanguy said...

Can you send me your email so I can send you a testable updated version?

Lindsay said...

Hello,

Many thanks for the tool!

I would like to use it to import some many to many relationships into customer tables. I am unable to get it to work however. Please could you explain what format the import file should be.

Thank you

ChrisS said...

Tanguy, excellent tool!

For first-time users, I found another post helpful for explaining the format required (semicolon delimited):
http://blog.interdynartis.com/how-to-import-nn-relationships-in-microsoft-dynamics-crm

Angel Rio said...

Quality stuff may be the key to invite the users to visit begin to see the blog site, that’s what this site provides.fix my relationship

Angeline Acord said...

Your blog article is really very nice and informative for the readers who want info regarding import export. Thanks for sharing such beneficial info with us.

Fabrication Chine | Fabricants En Chine

Unknown said...

Hi Tanguy, thanks for this tool!! When the file is not correct I see errors. Once I have the import file set up correctly, then nothing happens when I run Import. Any idea how I can get this working right?

Tanguy said...

Can you ask your question on GitHub so that I can help you better?

ashish sharma said...

How to export log file of N N relationship after all import data?

Tanguy said...

There is no log file available. The log list is not exportable for now but I can definitively add this feature

William Suycott said...

Any consideration for adding the ability on specific entities to specify the business unit? An example would be mass loading of security roles to system users that are in different business units, hence the security role name is present more than once - this causes the current tool to fail as it does not know how to deal with multiple iterations of the same name. Using Powershell this can be overcome, however I would prefer to have my admins using a simpler approach such as what you offer. The powershell approach is to obtain the business unit guid first and then use that in the search for the rolename i.e.
$businessunitguid = (Get-CrmRecords -EntityLogicalName businessunit -Fields * -FilterAttribute name -FilterOperator eq -FilterValue $crmuser.businessunit -TopCount 1).CrmRecords.businessunitid this picks up the guid for the email address passed in, and then $rolename1_id = fiscrm-get-secroleidbyname $crmuser.rolename1 $businessunitguid picks up 1 or more guids of the rolenames (if the length of $rolename1_id is less than 36 then I am dealing with a table of similar role names, and selection of the first one - or $rolename1_id.GetValue(0) will be the correct one for the business unit. Adding this type of logic in for those entities that are reactive to businessunit settings would help expand the use of this tool significantly.

Regards,
Bill.suycott@fisglobal.com

Tanguy said...

Hi William,
The tool can handle this scenario if you work with role id instead of role name. You can prepare all the work in Excel then export only required information (ie. role id/user information)