Dataverse – Convert UTC Time to User Timezone in Plugin

Today, I’ll share a quick tip on converting the UTC date to the User’s Timezone settings in the Plugin (once you read the logic, you can also implement this logic into Power Automate/Custom API). In Dataverse, we can set our timezone in the below UI (go to Settings > Personalized Settings > on General Tab, you can select “Set the time zone you are in“):

Set the user's time zone

Set the user’s time zone

Continue reading “Dataverse – Convert UTC Time to User Timezone in Plugin”

[Low Code] Send Translated Message to User using App Notification

Today we will learn how to create a Dataverse Instant plug-in using the AITranslate function. The purpose of AITranslate is to translate a message to the targeted language. For today’s scenario, we will learn how to query the selected Dataverse User’s UI Language and send the translated message using XSendAppNotification. FYI, 2 years ago I once wrote a similar topic that consumed the Azure Cognitive Service and used it in Power Automate Flow which you can read here. Since then, we have had the option to use it directly in Dataverse which is exciting! ๐Ÿ˜Ž

Continue reading “[Low Code] Send Translated Message to User using App Notification”

Build a Dataverse Plugin and use AIClassify to simplify business process

For those who don’t know, now we can call AI functions within Dataverse which helps to simplify lots of business processes. One of the scenarios that we will learn today is regarding Case/Feedback/Incident creation where users can just put minimal information such as “Title“, “Description“, and Customer” and let the AI help us to set the correct “Subject” to route the case to the specific department (this is another process which not being demonstrated in this blog post). For example, we have “Problem“, “Billing“, “How To“, and “Licensing“. Then, if none of the categories are found, we can route the Case to “Default Case” which the team in this Department helps to clarify/route the Case to the correct Team.

Continue reading “Build a Dataverse Plugin and use AIClassify to simplify business process”

Dataverse: Implement Pre-lock in a plug-in transaction

Lately, my mind has traveled a lot on designing a plugin that can handle concurrency issues. Even though the framework itself has UpdateRequest and we can pass the RowVersion, I found the implementation does not always fit with some of the scenarios especially if you want to avoid throwing “Error” in the design. And, after several days, I stumbled onto the “theory” about concurrency issues which didn’t make sense to me at first (stupid me ๐Ÿคฃ). And hey, it definitely works which makes me write this blog post! So, to help you understand the scenario, I created the below tables:

Dataverse tables for the scenario + logic

Dataverse tables for the scenario + logic

We want to ensure that the Applied Promotion (SUM of Promotion Amount) will not be applied more than the Promotion Limit.

Continue reading “Dataverse: Implement Pre-lock in a plug-in transaction”

Dataverse: Create an API to update Base Currency

This time, I’ve got a request from Trung Dลฉng Nguyแป…n where he wants to update the base currency based on the updated Currency inputted into the Transaction Currency table. When I check on the system behavior, the Currency (Base) information will be updated as long as we update at least one “Currency” attribute. Please note that because we need to update the Currency attribute, it might trigger the plugin step you set on that entity.

Sample Currency
Continue reading “Dataverse: Create an API to update Base Currency”

MDA: Learn Xrm.WebApi.executeMultiple

Back again with a deep dive series where we will learn about Xrm.WebApi.executeMultiple. The purpose of the function is to make batch requests (the real-world scenario is to make a bunch of CUD – Create/Update/Delete operations). Because this is a batch scenario, the performance will be faster than the individual request. And, we also set the requests as a transaction based. This enables us to roll back the changes as long as they are in the same batch.

Continue reading “MDA: Learn Xrm.WebApi.executeMultiple”

Dataverse: How the RelatedEntities Plugin Works

Last week we learned how the RelatedEntity’s performance compares to normal creation. We will create plugins for today’s blog post and inspect how it works. For the side topic, we will also cover CreateMultiple and see if we can make the customizations better in terms of performance. Let’s go!

Continue reading “Dataverse: How the RelatedEntities Plugin Works”

Dataverse: Performance Benchmark Create Related Entity via a chain of Create vs RelatedEntities property

Today’s blog post will be very technical, comparing creating a chain of related entities vs using RelatedEntities properties.

Demo’s Relationship

As you can see in the above image, Contact can have multiple Parents. And each of the Parents can have multiple Children. For our demo today, we will create 1 Contact > 10 Parents > and for each parent, we will create 10 children. Please note that for testing purposes, there is no plugin at all (this scenario was updated after a request from Aylwin Wijaya).

Continue reading “Dataverse: Performance Benchmark Create Related Entity via a chain of Create vs RelatedEntities property”

Dataverse: About Masking Rule ๐Ÿ’Ž

I found an undocumented feature in Dataverse while exploring a topic for today’s blog post. The feature basically helps us to mask the value if the value matches with the RegEx (Regular Expression) that we are set. This feature can be handy if the customer has a strict requirement to not allow anyone to read some type of value. For example, you want to hide Email, Social Security Number, etc.

First, I create a new string attribute named “tmy_demostring” and set the “Enable column security” to check:

Set "Enable column security"
Continue reading “Dataverse: About Masking Rule ๐Ÿ’Ž”

MDA: Send In-App Notification using Instant plug-in and call it from Ribbon Button

In this blog post, we will learn how to send Model Driven Apps In-App notifications using an Instant plug-in (Dataverse Accelerator App). For those who don’t know, Instant Plug-in will help to create a custom API in Dataverse which we can reuse in every part that needs (On Plugin, Power Automate, etc). The trigger point will be using the Ribbon button that will call JS code (as per writing, the existing Power Fx method is unable to call the plugin – not an error, just can’t work ๐Ÿฅฒ). Let’s go into the implementation!

Continue reading “MDA: Send In-App Notification using Instant plug-in and call it from Ribbon Button”