This is the Twelfth post in the series. If you want to go to previous post click here.
From the series of steps this post is dedicated to Step-Testing:
As a Eleventh Step we will Verify & Test the Integration between Business Central and Dataverse for Custom table we created in both the environments.
Initial Stage post Deploying the Extension, we access the Pages for first time.
We have below data in Dataverse Prospects table:
In BC when we access to CDS Prospects Page:
In BC when we access to Prospects Page:
First we will Add one Record in Dataverse:
Now if we check CDS Prospects Page:
If you remember on CDS Prospects Page we have written code on OnInit trigger to run codeunit – CRM Integration Management, so when page is opened, the data is synchronized to CDS Prospects Page.
On CDS Prospects Page, we have also added action Create in Business Central, if we choose this action:
The record in Dataverse will get transferred to Prospect Table in Business Central
Now Let us Add one Record in Business Central, from Prospect Page.
Business logic for calculating Forcast Revenue is not written in BC, but we have in Dataverse table.
When we synchronize data from BC to Dataverse, that will get calculated automatically.
Select the record we just added in BC. Action-> Dataverse-> Coupling-> Setup Coupling
On the new page that opens, Select Create New, And click OK.
Since we have selected Synchronize After Coupling and direction BC to Dataverse, the record will get transferred to Dataverse Table.
Also you can see the other fields too got calculated. Now if we Synchronize back to BC these fields will get updated in BC.
You can see the Synchronization is happening in both directions.
You can make necessary changes to code in sample walkthrough to achieve your desired results.
Hope you enjoyed learning this trick, and will use in your projects, the skill learned from this series of posts.
I will come up with more similar stuffs. Till then keep exploring, learning and sharing with others.
Take care of yourself and your loved ones. Put your mask, maintain safe distance and don’t forget to get vaccinated.