• Home
  • About Us
  • Contact Us
  • Privacy Policy
  • Special Offers
Business Intelligence Info
  • Business Intelligence
    • BI News and Info
    • Big Data
    • Mobile and Cloud
    • Self-Service BI
  • CRM
    • CRM News and Info
    • InfusionSoft
    • Microsoft Dynamics CRM
    • NetSuite
    • OnContact
    • Salesforce
    • Workbooks
  • Data Mining
    • Pentaho
    • Sisense
    • Tableau
    • TIBCO Spotfire
  • Data Warehousing
    • DWH News and Info
    • IBM DB2
    • Microsoft SQL Server
    • Oracle
    • Teradata
  • Predictive Analytics
    • FICO
    • KNIME
    • Mathematica
    • Matlab
    • Minitab
    • RapidMiner
    • Revolution
    • SAP
    • SAS/SPSS
  • Humor

Improving Dynamics 365 Data Integrations with Alternate Keys

January 22, 2021   CRM News and Info
3190124784 Improving Dynamics 365 Data Integrations with Alternate Keys

Dynamics 365 Data integrations is something that we’re quite familiar with – whether it’s a custom integration tailored for one of our customers or it’s utilizing our popular pre-built solution CRM For Distribution.  Microsoft added alternate key support to Dynamics 365, which allows us to greatly improve integration speed.

The challenge

One challenge that we’ve had in the past was speed. In other words, how much time it takes to actually get your data from another system into Dynamics 365. If all that’s needed is to Create records, then speed usually isn’t an issue. The challenge comes into play when data already exists in Dynamics 365 or you need to backfill data. This could sometimes take several days to several weeks! One of the main reasons for this was that this required 2 steps:

  • First, query Dynamics 365 to determine if the record you want to update already exists
  • If it doesn’t exist, then Create it. If it does exist, then Update it.

That might not seem like much, but if you can imagine trying to backfill thousands or millions of rows of data, this can take a huge toll on performance.

The solution

A few years ago, Microsoft began allowing Dynamics 365 developers to use Upsert statements.  Upserts can dramatically improve the speed of your data processing. Instead of making 2 separate calls to Dynamics 365, an Upsert allows for one call that can determine if a record needs to be Updated or Created based on a unique key. The key defines the unique identifier for the record (using one field or a combo of fields).

With the introduction of alternate keys in Dynamics 365 not too long ago, this made using Upsert statements incredibly easy. Alternate keys provide developers a way to specify their own unique identifier for an entity based on the source data. Alternate keys also provide a safe-net to prevent duplicate records when used, because it is enforced at the database level.

Developers can create an alternate key programmatically or via the power platform admin center. You can specify up to 5 alternate keys per entity which is sufficient. There are a few other constraints as well, but these likely won’t hold you back from using them:

  • Only field types of decimal, whole number, single line of text, datetime, lookup and picklist can be included in the key
  • All fields included in the key must be allowed to be populated via either a create or update of the entity records
  • Field-level security needs to be turned off for the included fields (which is the default)
  • Fields can’t be logical or inherited. For example, address fields on Account and Contact entities
  • The key size can be a maximum of 900 bytes and 16 columns
  • Certain special characters (/,<,>,*,%,&,:,\) in key field values will cause errors when performing a Get or Patch

The challenge with Alternate Keys

You may run into a challenge when creating Alternate Keys in an existing Dynamics 365 organization if it already contains duplicate records as defined by the Key. In that case, you will notice that the Key status is set to Inactive. In order to Activate it, you must eliminate the duplicate records, either by deleting the duplicates or removing the values on one of the corresponding fields for each duplicate record.

You can find duplicates in Dynamics 365 a couple different ways:

Create and publish a duplicate detection rule. Then, run a duplicate detection job on all records for that entity.  This process works well for the most part, but can be slow if you have a ton of data.
or
Use the Dynamics 365 SDK or 3rd party tools which can help you identify  duplicates within minutes.

Note: While Dynamics 365 allows you to merge records, this does not remove the duplicate record from the database, so the alternate key will remain Inactive. You can give your end users control over which duplicate records are removed by instructing them to merge the records or utilize a custom merge process. Then, use an automated process to delete the Inactive merged records.

We’ve been implementing alternate keys with Upserts in our data integration solutions for our customers and we have seen an incredible improvement in speed! It allows us to push more data in a timely manner and the keys help enforce record uniqueness at the database level which in turn makes our customers happy.

If you want to learn more about how you can improving Dynamics 365 data integrations with alternate keys, contact Beringer today!

Beringer Technology Group, a leading Microsoft Gold Certified Partner specializing in Microsoft Dynamics 365 and CRM for Distribution. We also provide expert Managed IT Services, Backup and Disaster Recovery, Cloud Based Computing and Unified Communication Solutions.

Let’s block ads! (Why?)

CRM Software Blog | Dynamics 365

Alternate, data, Dynamics, Improving, integrations, Keys
  • Recent Posts

    • The Neanderthals
    • What the swarm of new Azure announcements mean
    • Importance of Integrating SharePoint and Dynamics 365 in an SMB
    • InfoWars Surrenders
    • Invest Your Time in the Right Skills to Become a Data Scientist in 2021
  • Categories

  • Archives

    • March 2021
    • February 2021
    • January 2021
    • December 2020
    • November 2020
    • October 2020
    • September 2020
    • August 2020
    • July 2020
    • June 2020
    • May 2020
    • April 2020
    • March 2020
    • February 2020
    • January 2020
    • December 2019
    • November 2019
    • October 2019
    • September 2019
    • August 2019
    • July 2019
    • June 2019
    • May 2019
    • April 2019
    • March 2019
    • February 2019
    • January 2019
    • December 2018
    • November 2018
    • October 2018
    • September 2018
    • August 2018
    • July 2018
    • June 2018
    • May 2018
    • April 2018
    • March 2018
    • February 2018
    • January 2018
    • December 2017
    • November 2017
    • October 2017
    • September 2017
    • August 2017
    • July 2017
    • June 2017
    • May 2017
    • April 2017
    • March 2017
    • February 2017
    • January 2017
    • December 2016
    • November 2016
    • October 2016
    • September 2016
    • August 2016
    • July 2016
    • June 2016
    • May 2016
    • April 2016
    • March 2016
    • February 2016
    • January 2016
    • December 2015
    • November 2015
    • October 2015
    • September 2015
    • August 2015
    • July 2015
    • June 2015
    • May 2015
    • April 2015
    • March 2015
    • February 2015
    • January 2015
    • December 2014
    • November 2014
© 2021 Business Intelligence Info
Power BI Training | G Com Solutions Limited