Enforce ConcurrencyBehavior on DataverseServiceClient

Celebrating the GA of DataverseServiceClient, let's talk about how to implement concurrency (if there are two users updating the same data at the same time, the system must ensure only the first update success and make fail the other) using an out-of-the-box feature. From Dataverse itself, we have UpdateRequest and DeleteRequest messages that have ConcurrencyBehavior … Continue reading Enforce ConcurrencyBehavior on DataverseServiceClient

Create Field Security Profile Programmatically in Dataverse

Recently, my friend (Low Ming Hua) told me about an interesting scenario related to Field Security Profile. He needs to enable lots of attributes and set the Field Permission to specific teams (he also shared with me his code and I modify it!). For those who don't know, we can enable Field-level security to control … Continue reading Create Field Security Profile Programmatically in Dataverse

How to test service protection API limits in Dataverse

When I read this documentation about Service protection API limits, I was curious about the easiest way to get the error to validate the code in the documentation and enhance it. I read the documentation and found out about Dataverse search, which has a stricter policy (one request per second) which means it is easier to test. Service protection … Continue reading How to test service protection API limits in Dataverse

How to use the getUserPrivilege function in Dataverse Client API

getUserPrivilege is a function that will return canRead, canCreate, and canUpdate. This function correlated with the Field Level Security feature makes it suitable to check if users have enough privilege to run our custom function on Javascript. For example, we have below customization on formOnLoad: var BlogJs = BlogJs || {}; (function() { this.formOnLoad = function(executionContext){ onLoadCustomerId(executionContext); setValueIcNumber(executionContext); }; var onLoadCustomerId … Continue reading How to use the getUserPrivilege function in Dataverse Client API

Dynamics CRM: Populate Data using InitializeFrom Function

Do you notice when we create a Lead and qualify it in Dynamics CRM, the out-of-the-box feature will convert the Lead to Contact (all the data that was input in Lead, automatically populated in the Contact)? And sometimes, we are also being requested to make the same feature (mapping the data from one table to … Continue reading Dynamics CRM: Populate Data using InitializeFrom Function

Create Dataverse Record and Set SharedVariable From PowerAutomate

In Dataverse, we can add several additional parameters when we request something that you can check in this documentation. And from all the optional parameters provided, my favorite is the "Tag" parameter that allows us to pass SharedVariable to the Plugin. In the documentation above, you can see how we can pass those parameters using a WebAPI … Continue reading Create Dataverse Record and Set SharedVariable From PowerAutomate

Fixed contractResolver showed up when using Swashbuckle Swagger .NET 6

When using Swagger and I want to implement JsonPatchDocument to do Patch operation in my WebApi, I noticed the class can't be recognized automatically in the Swagger UI. contractResolver object detected in SwaggerUI Below is a sample of my code for my Controller that uses JsonPatchDocument: using LearningCqrs.Core; using LearningCqrs.Core.Handler; using LearningCqrs.Data; using LearningCqrs.Features.Users; using MediatR; using Microsoft.AspNetCore.Authorization; using … Continue reading Fixed contractResolver showed up when using Swashbuckle Swagger .NET 6

Empty Available Authorization when using Swashbuckle Swagger .NET 6

When I learned to implement authorization in my WebAPI and tested it in Swagger, I noticed the "Available authorization" page was empty (after clicking the lock icon): Empty Authorization dialog For those who don't know Swagger, you can think of this as a framework that offers a systematic way of notating the interface of any RESTful … Continue reading Empty Available Authorization when using Swashbuckle Swagger .NET 6

Dataverse: Export Import Solution from your command prompt using PowerApps CLI

Powerapps CLI have lots of function to support our daily activities. The most useful to me of course the command "pac plugin init" that automatically creates Plugin Project. Today, we will learn about Authentication and Solution commands to do export-import across the environment. Installing You can find the download link of the PowerApps CLI on this page. Once you have … Continue reading Dataverse: Export Import Solution from your command prompt using PowerApps CLI

Dataverse: Duplicate Detection Rules vs Keys

There are several ways to make your Dataverse data as clean as possible. Out-of-the-box, you can create alternate keys or you can implement Duplicate Detection Rules. Or you can implement Custom Validation on the Plugin to achieve more dynamic conditions (you can write any validation logic that you want). Today we will learn the out-of-the-box features (alternate keys … Continue reading Dataverse: Duplicate Detection Rules vs Keys