C# Code · Dynamics 365 Quick Tips

Dataverse Group by Attribute in Fetchxml C#

It’s been while since I have written any blog. Today blog will be on quick tip to group attribute and get result in c# using Fetch xml and Linq. While working on one of the requirement I was asked to get the data from CRM and group it by Owner. I have used below code…… Continue reading Dataverse Group by Attribute in Fetchxml C#

Advertisement

C# Code · Data Migration And Integration · Dynamics 365 Quick Tips · Dynamics Plugins

{CDS Developer Quick Tip} Set Lookup field using Altername key during Create and Update record from C#

One of integration performance issue is to set related entity lookup field where we need to get record ID and then set the lookup field while creating/updating record from C#. As per latest update of SDK, we can now set lookup field using Alternate Key without having to first get record ID. This will improve…… Continue reading {CDS Developer Quick Tip} Set Lookup field using Altername key during Create and Update record from C#

C# Code · Dynamics 365 WEB API

Dynamics CRM Web API C# Auto Refresh Access Token while performing API request to CDS

As we know to connect to CDS WEB API from C# application we first need to acquire access token and validity of that is 1 hour. While performing small number of requests this will be sufficient. However when we want to run long running process we will get HTTP 400 error when token expires. To…… Continue reading Dynamics CRM Web API C# Auto Refresh Access Token while performing API request to CDS

C# Code · Customization and Configuration

Office365 authentication type and OrganizationServiceProxy class for connecting to Common Data Service Deprecated

Use of the WS-Trust authentication security protocol when connecting to Common Data Service is no longer recommended and has been deprecated. This change impacts custom client applications that use “Office365” authentication and the Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy or Microsoft.Xrm.Tooling.Connector.CrmServiceClient classes. How do You know If your code is using WS-Trust authentication? When using the CrmServiceClient class with a connection string:…… Continue reading Office365 authentication type and OrganizationServiceProxy class for connecting to Common Data Service Deprecated

C# Code

{Code Snippet}Get Access Token using Basic Authentication and Client credentials Grant Type

While working on one of the integration in our project, We had to get access token using Basic Auth from our external system to perform the CRUD operation. We have used HttpClient and Client credentials Grant Type. Code to get Access Token using Basic Auth private static async Task GetToken(string clientId, string clientSecret, string url)…… Continue reading {Code Snippet}Get Access Token using Basic Authentication and Client credentials Grant Type

C# Code

Dynamics 365 CRM Execute messages in a single database transaction

It is a common requirement in business applications to coordinate changes of multiple records in the system so that either all the data changes succeed, or none of them do. In database terms, this is known as executing multiple operations in a single transaction with the ability to roll back all data changes should any…… Continue reading Dynamics 365 CRM Execute messages in a single database transaction