Thursday 14 December 2017

How to Import N:N relationship records in MS Dynamics CRM/365








Recently, I came across a scenario where I was expected to import a set of records in CRM which has related records,and  the relationship being a N:N.
I was just given an Excel file and there is no option to import related records out of the box(at least when this post was written).
So after spending a couple of hours, I found an easy way to do this.

Step 1: Import the records of the related entity as usual(using OOTB import feature). Now we have to figure out a way to just associate the records of these two entities.
For this example, lets assume I want to import records of Account and Product which are related with  a N:N.

Step 2: Import Accounts separately. Import Products separately via OOTB import feature.

Step 3: Now, download XRMToolBox.

Step 4: Make use of the N:N data


Step 5: Connect to the desired organization. Click on Load Metadata button.


Step 6:Select the Account Entity under First Entity option and the relationship name(N:N) . Select which attribute you want the app to find out for a particular account. For eg, Account Number or Account name etc.

Step 7: Select the corresponding relationship name.

Step 8: Select the Product Entity against Second Entity and the field name for identifying a Product record. Say Product ID.

Step 9: Now, select the csv file with only two columns. First Column should contain Account Id and the second column should contain contact id.
Ensure you dont add headers to this csv file.

Click on Import  and you can see the status of each line in the log.





Tuesday 26 September 2017

MS Dynamics 365, SDK-SOAPLogger Issue

If you have tried using SOAPLogger solution from the MS provided SDK, you might have noticed that the app will not prompt for username and password for the first time configuration.
Once you try to run this app, you will have to enter the crm server name based on the location of the datacentre.(Eg. crm.dynamics.com, crm8.dynamics.com etc).
once you enter this information, you will get the below information to select if the organisation is provisioned 0365.
If you type Y for yes, then actually it should prompt you for the username and password for the first time configuration.
However, it will not and you may get an exception that looks something like "No username specified ".

Resolution:
To resolve this, open CrmServiceHelper.cs and find for OnlineFederation and locate the below lines.
Comment the code in the highlighted area.

Build the project and run the code and now the app should prompt for the username and password.

Microsoft Dynamics 365 -Issue with Access Team Templates

I have been working on a project which involved creation of dynamic access team based on certain conditions.
As you might already know, dynamic access teams will utilize the access team templates.
In fact, Dynamics 365 comes with an out of the box access team template for opportunity entity.
My requirement was in such a way that, I had to delete the existing access team template and create new ones.
To my surprise, as soon as I removed the existing team template, I was unable to create any connections for opportunities. D365 threw an exception stating "No System Team Template found for opportunity entity".Though I had two team templates for opportunity entity, somehow D365 doesn't consider them as System and hence the issue.

Now, there is no other way than resetting the entire organisation which will definitely be an issue if the same org is being used by a pool of developers.
I would at least expect MS to provide an alert before deletion of this template else MS shouldn't have provided the option for deleting the OOTB team template.

So, if you are someone who is thinking about deleting the existing access team template, NEVER EVER DO THAT.!!

There is a workaround though to resolve the issue connection creation.
Let me know in the comment box if you are in need of knowing that.