Integrating with Microsoft Dynamics CRM Online
This article details how to integrate your Dynamicweb solution with Microsoft Dynamics CRM Online, so that users are imported from CRM Online to your Dynamicweb solution.
- Downloading the CRM integration files and placing them in the correct folders
- Creating a Data Integration activity
- Creating and scheduling an import activity
- Extending the integration with columns matching your data
Downloading and installing the CRM integration files
First you must download and copy the relevant files to your solution:
- Download the CRM Online Integration zip and extract it
- Copy the CrmIntegration.dll and the Microsoft.Xrm.Sdk.dll to the Dynamicweb bin folder
- Copy the integration activity template file - CrmUserImport.xml - to the Files/System/Integration/Jobs folder
You can now create a Data Integration activity from the template, so let’s do that.
Creating the Data Integration activity
To create the data integration activity:
- Go to Settings > Integration > Data Integration
- Click New activity from template
- Select the CrmUserImport template (the one you copied to Files/System/Integration/Jobs)
- Name it
- Click OK (you may have to wait a bit)
A new data integration activity has now been created – and you can schedule a batch integration task to run it at appropriate intervals.
Scheduling the import activity
To create a scheduled task executing the import activity:
- Go to Settings-> Integration-> Integration Framework Batch
- Click Add to create a new scheduled activity (Figure 4.1)
Configure the activity as in the screenshot above:
- Select the CRM Addin type
- Provide the CRM web service URL – in the format https://yourwebsite.com/XRMServices/2011/Organization.svc
- Leave the Domain empty if you use a live web CRM – but if you’re on a local network CRM, provide a domain and a password
- In the Contact columns field provide a comma separated string of the columns you want to retrieve from CRM Online, e.g. contactid,donotbulkpostalmail,ownerid,parentcustomerid,communityaccess,emailaddress1,firstname,lastname,new_username,new_password,jobtitle,address1_country,address1_city,address1_postalcode,address1 telephone1 - but this is entirely dependent on your CRM Online data
- Under Users Import Activity select the data integration activity you created during the previous step
- Select a destination group to add the imported users to
Of course, you also need to name the activity, and set a start time and an interval at which to repeat it.
In principle, you can now run the scheduled task and import your users – but in practice you must extend the integration to fit your CRM Online data.
Extending the integration
The integration activity template provided by us – CrmUserImport.xml – contains a default set of columns to retrieve from CRM Online – but you can (and probably should) add and remove columns from the job file to customize the integration.
To add a new column to the import:
- Add desired columns system names to the Scheduled task “Contact columns” list
- Open the data integration template (Files/System/Integration/Jobs) and edit the xml in a file editor of your choice
Add the columns to the Source > Schema > Table > Columns section in the following format:
- Open the corresponding integration activity in Data Integration
- Add new mappings from Source – the CRM columns you just added – to Destination (AccessUser columns in the Dynamicweb database)
- Save the job
Run the scheduled task and verify that the result is as expected. Logs can be found in /Files/System/Log/ScheduledTasks and in /Files/System/Log/DataIntegration.