When integrating with an external system, the system probably contains a key for records that are being imported. For example, if you are integrating Customers from an ERP system, there is a customer number that defines the uniqueness of the record. In Dynamics 365, the uniqueness of the record is defined by a GUID.
In order to make integrating both systems easier, Dynamics 365 entities have a concept of Keys. The idea is, we can define a key on an entity that will be used by an integrating system. For example, we can create an ERP Customer Number field on the entity. Then, if you are updating or deleting records in an integration, you can look up the record programatically by referencing the new key. In the backend, when you create a key, it creates a database index so the record lookup is optimized.
Let’s go through setting this up.
First, go to Customizations and select the entity you want to create a key on. Create a new field, e.g. ERP Key. Note the key needs to be a whole number, decimal number or a string.
Next, go to Keys:
Select New:
The key status will change from Pending to Active:
You will now be able to reference the key in your integration code.
I AM SPENDING MORE TIME THESE DAYS CREATING YOUTUBE VIDEOS TO HELP PEOPLE LEARN THE MICROSOFT POWER PLATFORM.
IF YOU WOULD LIKE TO SEE HOW I BUILD APPS, OR FIND SOMETHING USEFUL READING MY BLOG, I WOULD REALLY APPRECIATE YOU SUBSCRIBING TO MY YOUTUBE CHANNEL.
THANK YOU, AND LET'S KEEP LEARNING TOGETHER.
CARL