How to get only recently modified records for integration from Dynamics CRM using Azure Function C#.
Hello everyone in this blog we will see how we can query only recently modified data from dynamics CRM for our integration using Azure function in C#.
Open visual studio and create azure function, you can create an HTTP triggered function if you want it to run on a certain event or a timer trigger function that will run at specific times.
Install following packages to your solution.
The first task is to connect to our Dynamics CRM. We will use OAuth for connection, for that copy following code section to your function.
Note: Service root URL can be found in advance settings inside developer options.
Now next step is to use fetch XML query to get recent records. Please note that you can put any condition as per your requirement. Here I want to query yesterday’s records for integration.
Now we need this data in JSON format so we need to serialize it first. For that, I have created an account class that has all the attributes we will first assign them their values and then convert that object to JSON.
In this way, you can use fetch XML to get recent records using the Azure function. Hope this helps.