This blog post is step 3 of the Data Flow setup in combination with On Premise Gateway. In the last post in imported all of our ERP accounts to the CDS database. Now I wanted to import all active projects, and connect them to the the Accounts in CDS. There are a few odd things you have to do in the setup to make this work, but I will try to outline this without being to detailed..
First off we need to get familiar with the Alternative Keys in Dynamcis. In Account I created alternative key for AccountNumber. I need to do the same for Project.
![](http://crmkeeper.files.wordpress.com/2020/03/projects.png?w=81)
![](http://crmkeeper.files.wordpress.com/2020/03/image-005.png?w=961)
The field is also represented on the form. I choose to keep these as “Single Line Of Text”. Just keep it simple, because this doesn’t need to be advanced.
![](http://crmkeeper.files.wordpress.com/2020/03/image-006.png?w=595)
This is important so the import is able to match every time runs. Remember that the Data Flow is doing UPSERTS. It will create a new record if it can’t find the project number. Imports CAN’T connect to GUID’s because my ERP system does not have the CRM GUID.
Make.PowerApps.com
The most important thing you do here, is make sure you have the correct environment!!
![](http://crmkeeper.files.wordpress.com/2020/03/image-11.png?w=427)
![](http://crmkeeper.files.wordpress.com/2019/06/image-006.png?w=1024)
![](http://crmkeeper.files.wordpress.com/2020/03/image-13.png?w=590)
If you don’t understand this setup, look at my first blog about the DataGateway
![](http://crmkeeper.files.wordpress.com/2020/03/image-001.png?w=1024)
![](http://crmkeeper.files.wordpress.com/2020/03/image-002.png?w=1024)
The important pieces of information here are:
* Project Number
* Project Name
*Account Number
This is all i need to create a project in CRM and connect it to the Account
Connecting to Lookup
This is where you need to pay close attention. First you choose the project (or other entity) from a list of existing entities. The Alternate Key will display if you have done this correctly. If nothing is there you have to go back and start again with alternate keys
There are 2 lookups on project. Account and Contact. Account has 2 alternate keys, and Contact has 1 alternate key.
![](http://crmkeeper.files.wordpress.com/2020/03/image-14.png?w=677)
Account:
![](http://crmkeeper.files.wordpress.com/2020/03/image-004.png?w=947)
Contact:
![](http://crmkeeper.files.wordpress.com/2020/03/image-16.png?w=831)
This is why you will see 3 fields in the beginning of the mapping
1. ncg_Account.AccountNumber – Account looup identifier
2. ncg_Account.ncg_POAccountNumber – Accound lookup identifier
3. ncg_CustomerContact.EMailAddress1 – Contact lookup identifier
![](http://crmkeeper.files.wordpress.com/2020/03/image-003.png?w=1024)
I am using the AccountNumber for a different purpose, so let’s just forget this one for now. I am using the Account Number from ERP to the ERP field on the Account entity to create a match.
Schedule
After you have set a schedule, you should see the results in CRM:) In a later post I will tell you why I am connecting the project records to dynamics. A quick hint, Forms PRO and NPS!
![](http://crmkeeper.files.wordpress.com/2020/03/image-007.png?w=1024)
![](http://crmkeeper.files.wordpress.com/2020/03/image-12.png?w=942)