Dataverse Accelerator | API playground (Preview)

Hi Folks,

In this post, I will be talking about the features of Dataverse Accelerator in brief. Actually, the Microsoft Dataverse accelerator is an application that provides access to select preview features and tooling related to Dataverse development, it is based on Microsoft Power Pages. This is totally different from Dataverse Industry Accelerator.

Dataverse accelerator app is automatically available in all new Microsoft Dataverse environments. If your environment doesn’t already have it, you can install the Dataverse accelerator by going to Power Platform Admin Center –> Environments –> Dynamics 365 Apps –> Install App –> Choose Dataverse Accelerator

You can also refer to my previous blog post on installing it here if you prefer

Once installed, you should see something like below under the Apps

On selection of the Dataverse Accelerator App, you should see something like below, do note that you must have App-level access to the Dataverse accelerator model driven app, such as system customizer or direct access from a security role.

Now let’s quickly see what are features available with Dataverse Accelerator

FeatureDescription
Low-code plug-insReusable, real-time workflows that execute a specific set of commands within Dataverse. Low-code plug-ins run server-side and are triggered by personalized event handlers, defined in Power Fx.
Plug-in monitorA modern interface to surface the existing plug-in trace log table in Dataverse environments, designed for developing and debugging Dataverse plug-ins and custom APIs.
Do you remember viewing Plugin Trace logs from customizations, now you don’t need system administrator role to view trace logs, giving access to this app will do, rest everything remains the same.
API PlaygroundA preauthenticated software testing tool which helps to quickly test and play with Dataverse API’s.

I wrote a blog post earlier on using Low Code Plugins, you may check it out here, while using Plugin Monitor is pretty straight forward.

You can find my blog post on using Postman to test Dataverse API’s here.

Now let’s see how can use the API Playground, basically you will be able to test the below from API Playground similar to Postman. All you need to open the API Playground from Dataverse accelerator. You will be preauthenticated while using API Playground.

TypeDescription
Custom APIThis includes any Dataverse Web API actionsfunctions from Microsoft, or any public user-defined custom APIs registered in the working environment.
Instant plug-inInstant plug-ins are classified as any user-defined workflows registered as a custom API in the environment with a related Power Fx Expressions.
OData requestAllows more granular control over the request inputs to send OData requests.

Custom API, Instant Plugin – You select the relevant request in the drop down available in API Playground and provide the necessary input parameters if required for your request

OData request – Select OData as your request and provide the plural name of the entity and hit send

After a request is sent, the response is displayed in the lower half of your screen which would be something like below.

OData response

I will update this post as these features get released in my region(APAC), because at the time of writing this blog post, this API Playground feature is being rolled out globally and was still in preview.

The Dataverse accelerator isn’t available in GCC or GCC High environments.

Hope learned something about Dataverse Accelerator.

Cheers,

PMDY

Setup Copilot in a Model-driven app – Quick Review

Hi Folks,

Wondering how you can enable Copilot in Dynamics 365 Model Driven App …? Then you come to the right place, few days ago, I was trying to use it few days back but couldn’t. Hence this blog post is from my experience.

There were few things to configure for your Copilot to respond to your queries. So, I will be taking about that in this blog post today. Let’s get started…

Copilot in model-driven Power Apps was in Preview since July 2023.

Prerequisite: You must have a non-production environment with Dataverse database, apps, and data.

Step 1: Go to Power Platform Admin Center –> Select the environment –> Settings –> Product –> Features –> Select On for AI-powered experience as highlighted below, if you were App maker and want to try it for yourself, you would also need to check the option in yellow below.

Step 2: Go to Power Platform Admin Center –> Select the environment –> Settings –> Product –> Behaviour –> Select Monthly channel or Auto  for Model-driven app release channel option and click save.

Step 3: Well, this step is important, in this task, we configure a Dataverse table and columns for Copilot.

Go to Power Apps and make sure that you have the correct environment.

Select tables and navigate to the respective table for which you want to enable Copilot capability.

Step 4: Here I am using OOB Account entity, you can choose whichever entity you wish to setup.

Step 5: Navigate to Properties for the Account table as below

Step 6: Choose settings as highlighted below and click on save.

Step 8: Open the Account table and go views

Step 9: Here in this step, would need configure the Quick Find View, add the necessary fields to the view for it to be searchable for Copilot. Add in the fields which your users would be searching for in the Copilot.

Step 10: Here we have to make sure the fields are added to the view and then save and publish.

That’s it, the configuration is done.

Step 11: In this step, we will test the Copilot by opening the App in which the configured entity is available. Click on the Copilot icon as highlighted below, this shows the Chat window for Copilot

Step 12:

Test 1: Prompt: How many Accounts are there which Primary Contact starting with H? Well, it showed correctly as below.

Test 2: Prompt: Show Accounts whose Annual Revenue is more than 300,000? It showed correctly as below.

Hope this helps you to setup Copilot for your Model Driven Apps. I will leave it to yourself to try this out.

Make sure, you give all the details in the prompt itself, it will not be able to store the previous response, meaning you can’t continue your conversation providing information in bits and pieces. You can setup the same for your Custom entity also, make sure you add the fields to the quick find view of that entity.

It is not recommended for Production environments as it is still a preview feature. In case, the response is not accurate, you can report this to Microsoft by hitting thumbs up or thumbs down and provide the relevant feedback.

Lot more to come in the upcoming days, learning different aspects of Copilot became a necessity these days.

That’s it for today…hope this helps…

Cheers,

PMDY

Using Bulk Operations messages – #01 (Plugins)

Well, this could be a very interesting post as we talk about optimizing the Dataverse performance using bulk operation messages and too using Dataverse plugin customizations but wait, this post is not complete because of an issue which I will talk later in the blog. First let’s dig into this feature by actually trying out. Generally, every business wants improved performance for any logic tagged out to out of box messages and so developers try to optimize their code in various ways when using Dataverse messages.

Firstly, before diving deeper into this article, let’s first understand the differences between Standard and Elastic tables, if you want to know a bit of introduction to elastic tables which were newly introduced last year, you can refer to my previous post on elastic tables here.

The type of table you choose to store your data has the greatest impact on how much throughput you can expect with bulk operations. You can choose out of two types of tables in Dataverse, below are some key differences you can refer to: 

 Standard TablesElastic Tables
Data StructureDefined SchemaFlexible Schema
Stores data in Azure SQLStores data in Azure Cosmos DB
Data IntegrityEnsuredLess Strict
Relationship modelSupportedLimited
PerformancePredictableVariable, preferred for unpredictable and spiky workloads
AgilityLimitedHigh
PersonalizationLimitedExtensive
Standard and Elastic Table Differences

Plugins:

With Bulk Operation messages, the APIs being introduced are Create MultipleUpdateMultiple,DeleteMultiple (only for Elastic tables), Upsert Request(preview). As of now you’re not required to migrate your plug-ins to use CreateMultiple and Update Multiple instead of Create and Update messages. Your logic for Create and Update continues to be applied when applications use CreateMultiple or UpdateMultiple

This is mainly done to prevent two separate business logics for short running and long duration activities. So, it means Microsoft have merged the message processing pipelines for these messages (Create, Create Multiple; Update, Update Multiple) that means Create, Update messages continue to trigger for your existing implemented scenarios, when you update to use Create Multiple, Update Multiple still the Create, Update will behave.

Few points for consideration:

  1. While I have tested and still could see IPluginExecutionContext only provides the information and still I have noted Microsoft Documentation suggests using IPluginExecutionContext4 for Bulk Messages in Plugins where it is being shown as null yet.
  2. While you were working with Create, Update, Delete, you could have used Target property to get the input parameters collection, while working with Bulk Operation messages, you need to use Targets instead of Target.
  3. Instead of checking whether the target is Entity you need to use Entity Collection, we need to loop through and perform our desired business logic
  4. Coming to Images in plugin, these will be retrieved only when you have used IPluginExecutionContext4.

Below is the image from Plugin Registration Tool to refer(e.g. I have taken UpdateMultiple as reference, you can utilize any of the bulk operation messages)

Sample:

Below is the sample, how your Bulk operation message plugin can look like…you don’t need to use all the contexts, I have used to just check that out.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Crm.Sdk;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Query;
namespace Plugin_Sample
{
public class BulkMessagePlugin : IPlugin
{
public void Execute(IServiceProvider serviceProvider)
{
IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));
IPluginExecutionContext2 context2 = (IPluginExecutionContext2)serviceProvider.GetService(typeof(IPluginExecutionContext2));
IPluginExecutionContext3 context3 = (IPluginExecutionContext4)serviceProvider.GetService(typeof(IPluginExecutionContext3));
IPluginExecutionContext4 context4 = (IPluginExecutionContext4)serviceProvider.GetService(typeof(IPluginExecutionContext4));
ITracingService trace = (ITracingService)serviceProvider.GetService(typeof(ITracingService));
// Verify input parameters
if (context4.InputParameters.Contains("Targets") && context.InputParameters["Targets"] is EntityCollection entityCollection)
{
// Verify expected entity images from step registration
if (context4.PreEntityImagesCollection.Length == entityCollection.Entities.Count)
{
int count = 0;
foreach (Entity entity in entityCollection.Entities)
{
EntityImageCollection entityImages = context4.PreEntityImagesCollection[count];
// Verify expected entity image from step registration
if (entityImages.TryGetValue("preimage", out Entity preImage))
{
bool entityContainsSampleName = entity.Contains("fieldname");
bool entityImageContainsSampleName = preImage.Contains("fieldname");
if (entityContainsSampleName && entityImageContainsSampleName)
{
// Verify that the entity 'sample_name' values are different
if (entity["fieldname"] != preImage["fieldname"])
{
string newName = (string)entity["fieldname"];
string oldName = (string)preImage["fieldname"];
string message = $"\\r\\n – 'sample_name' changed from '{oldName}' to '{newName}'.";
// If the 'sample_description' is included in the update, do not overwrite it, just append to it.
if (entity.Contains("sample_description"))
{
entity["sample_description"] = entity["sample_description"] += message;
}
else // The sample description is not included in the update, overwrite with current value + addition.
{
entity["sample_description"] = preImage["sample_description"] += message;
}
}
}
}
}
}
}
}
}
}

I have posted this question to Microsoft regarding the same to know more details on this why the IPluginExecutionContext4 is null , while still I am not sure if this is not deployed to my region, my environment is in India.

Recommendations for Plugins:

  • Don’t try to introduce CreateMultiple, UpdateMultiple, UpsertMultiple in a separate step as it would trigger the logic to be fired twice one for Create operation and another for CreateMultiple.
  • Don’t use batch request types such as ExecuteMultipleRequest, ExecuteTransactionRequest, CreateMultipleRequest, UpdateMultipleRequest, UpsertMultipleRequest in Plugins as user experiences are degraded and timeout errors can occur.
  • Instead use Bulk operation messages like CreateMultipleRequestUpdateMultipleRequest, UpsertMultipleRequest
    • No need to use ExecuteTransactionRequest in Synchronous Plugins as already they will be executed in the transaction.

    Hope this guidance will help someone trying to customize their Power Platform solutions using Plugins.

    I will write another blog post on using Bulk operation messages for Client Applications…

    Cheers,

    PMDY

    Start Transitioning your Dynamics 365 Client Applications to use Dataverse Client

    Hi Folks,

    This blog post deals about what you need to do for your client applications in specific to use Dataverse Client API instead of existing CrmServiceClient(Core Assemblies) API.

    Below were 3 reasons cited by Microsoft and why we need to just be aware of this move.

    1.Cross Platform Application Support: With the introduction of Microsoft.PowerPlatform.Dataverse.Client, the new Dataverse Service Client supports Cross Platform Support.

    2. MSAL Authentication: New Dataverse ServiceClient API uses MSAL while our older CrmServiceClient API uses ADAL. ADAL.Net is no longer supported.

    3. Performance and functional benefits: We can have one authentication handler per web service connection instead of just one per process. The Dataverse Service Client class supports a smaller interface surface, inline authentication by instance, and Microsoft.Extensions.Logging.ILogger.

    What’s the impact?

    • Plug-ins or custom workflow activities – no changes
    • New or existing online applications – changes are needed but not immediately…
    • On-premises applications – this article is not for you, yet

    So, meaning it impacts Online Client applications only. While you really don’t need to worry much about this the class member signatures of ServiceClient and CrmServiceClient are the same, except for the class names themselves being slightly different. Application code should not need any significant changes.

    As of now, no changes to your code are required, but it is better to keep in mind that in the future the CRM 2011 Service End Point would be deprecated, and this change would be made mandatory.

    So, what should you do to incorporate this change?

    Use the following assemblies from Nuget instead of CrmSdk.CoreAssemblies

    Add the below using statement to use Microsoft.PowerPlatform.Dataverse.Client

    Use ServiceClient instead of CrmServiceClient, ServiceClient would return your OrganizationService.

    Instead of

    Be strategic to minimize the impact to your apps.

    Cheers,

    PMDY

    Entity not visible in Kingswaysoft CDS/CRM Destination component editor – Quick Fix

    Hi Folks,

    I got a requirement do develop integration between Dynamics 365 and 3rd party data warehouse. Here I have to use SSIS for Integration. Obviously when you want to write data to Dynamics from SSIS, we need to use Kingswaysoft SSIS Components. So, I have retrieved the data from the files coming from 3rd party warehouse and writing the data in to Dynamics using Kingswaysoft Destination component.

    During the implementation, I had to create a new entity in Dynamics 365 CE as below and configure it in Kingswaysoft adapter.

    But I was unable to select the newly created entity in Destination Entity inside the destination component editor as below. I tried refreshing metadata, rebuild the solution, closed visual studio multiple times, cleared the cache but none of them helped. As shown below. I was not able to select the respective newly created entity.

    I was unable to get that even after 2 days…I tried to create another package and set the Kingswaysoft SSIS Destination editor, so here I am able to see the newly created entity. There comes the fix.

    So here are the two ways how you can do it using the same SSIS Package itself without using another.

    1. Step: If your connection manager uses SOAP 2011 (Dynamics 365 CE, Dataverse, CRM 2016, 2015, 2013, 2011) …then you can create one more connection with the same configuration.

    Then you should see something like below in your connection manager’s section.

    Just delete the old connection and rename the new connection to old connection manager name and update the lost references at all places in your package.

    2. Step: Change your service end point to Web API as highlighted below

    Just update any missing references…that’s it….

    Thank you for reading…if you have any issue on the same, please let me know..

    Cheers,

    PMDY

    Open Dynamics 365 Model Driven Apps faster with these two tips…Quick Tip

    Hi Folks,

    With increase in the adoption of Power Platform, the number of Dynamics 365 Model Driven apps are growly rapidly.

    Did you ever face any performance issues opening up your App…? These tips if remembered can definitely help you down the road in your implementations.

    Tip 1: Want to load your App faster…are you trying to open a URL like this https://ecellorsdev.crm8.dynamics.com/ , then just append main.aspx, this makes your App to load faster.

    Tip 2: Are you trying to open the settings page similar to this URL https://ecellorsdev.crm8.dynamics.com/main.aspx?settingsonly=true and it keeps on loading…

    Then right click on your browser and choose to duplicate your tab.

    Both these techniques, helps your App to resolve quickly…don’t forget to try out and see while working on your projects.

    Cheers,

    PMDY

    Calling Command Line Commands from C# – Quick Tip

    Hi Folks,

    In today’s no code world and AI, while most of the Apps are developed using low code approach, sometimes we have to go with the traditional way of development to handle any integrations with other systems.

    When we give anyone Command Line script and ask them to execute, the other person would immediately open Search bar at the bottom available in Windows and start entering cmd. Immediately command prompt window appears and will be able to execute the same command.

    But what if we ask to execute command line Commands from C# code…? So, in this blog post, I will show you how easily you can call command line commands with a simple example. Let’s get started…

    Here in order to showcase, I will just use a basic command line command and run it from C#.

    Everyone knows how to find the ipconfig command right, which just shows the internet protocol configuration when entered in command line like below.

    In order to execute it from Console Application using C#, we would need to utilize the System. Diagnostics. You can utilize the below C# code.

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Diagnostics;
    namespace BatchTest
    {
    class Program
    {
    static void Main(string[] args)
    {
    Process pro = new Process();
    pro.StartInfo.FileName = "cmd.exe";
    pro.StartInfo.CreateNoWindow = true;
    pro.StartInfo.RedirectStandardInput = true;
    pro.StartInfo.RedirectStandardOutput = true;
    pro.StartInfo.RedirectStandardError = true;
    pro.StartInfo.UseShellExecute = false;
    pro.Start();
    pro.StandardInput.WriteLine("ipconfig");
    pro.StandardInput.Flush();
    pro.StandardInput.Close();
    pro.WaitForExit();
    Console.WriteLine(pro.StandardOutput.ReadToEnd());
    Console.ReadKey();
    }
    }
    }

    When we execute this command, it shows exactly same as what we saw above with Command Line.

    In the same way we can call any Command Line Commands from C#. I have to use this approach for my Power Platform Implementation integration to decrypt encrypted messages using PGP and I found it to be very helpful and thought of sharing with all of you. If you were looking for a program to decrypt, you can check out for previous blog post here.

    Cheers,

    PMDY

    Unable to persist the profile – Quick Tip

    Hi Folks,

    Are you debugging the Dynamics 365 Plugins using Plugin Profiler, did you ever notice this problem that you were unable to persist profile so as to debug your plugin. Did you got frustrated as you couldn’t capture the profile even after lot of tries installing and uninstalling the profiler. Just read on. I am writing this blog post after fixing a similar situation with one of my Plugin.

    First of all, I would advise you to check the below.

    1. Plugin trace log under Settings –> Plugin Trace Log.
    2. Check if your Plugin is being called multiple number of times
    3. Check the filtering attributes of your Plugin whether it is causing to go in an infinite loop
    4. Suppose if you have added an image, did you select the respective attributes of the image
    5. Did you add sufficient depth conditions to prevent infinite loop executions.
    6. At what step is your plugin running, is it in PreOperation, PostOperation.? In case you were throwing an error, change it to Prevalidation step and check.
    7. Were you using persist to entity option while debugging, try changing to throw an error and see.
    8. If you note that the system becomes unresponsive and you were not able to download the log file, then definitely your logic is getting called multiple times. Please reverify.

    Once you have verified these, you should be able to find out the exact root cause of the issue…I will leave to yourself.

    Thank you…and enjoy debugging…Power Platform Solutions…

    Cheers,

    PMDY

    Your Visual Studio doesn’t respond when opening Dataflow tasks in SSIS Packages in your local development machine? – Quick Tip

    Hi Folks,

    Thank you for visiting my blog today, this is another post talking about SSIS Data Flow Task which I encountered while performing data loading tasks using SSIS and would like to share with everyone.

    Did your Visual Studio keeps not responding when you were opening the dataflow tasks for the SSIS Packages you or your team created as shown in image below. And you always try to close the same from task bar since you can’t work and keeps you frustrating, then this tip is absolutely for you.

    The problem is actually with your Connection Manager, in your data flow task, you might have OLE DB Connections which the package is using in order to write information if there were any failures in the Data flow. In my case, I was actually writing to a SQL Table using a OLE DB Destination component.

    If you cross check that SQL server availability, you should see the SQL Server (Your Instance) is stopped when you check in Start–> Services in the PC. In my case, I was using SQL Server (SQLEXPRESS01) in the SSIS Package as below.

    And hence the SQL Server service is in stopped mode, the Visual Studio is not able to acquire the connection to open the package. You were almost there..

    Just Start the service which you were using and voila…. your Visual Studio should open normally.

    Thank you for reading….

    Cheers,

    PMDY

    Improve your SSIS Data Flow Task Performance by just setting a flag – Quick Tip

    Hi Folks,

    Thank you for visiting my blog today, this post is all about improving the performance of SSIS Data Flow Task which I would like to share with everyone.

    Do you know, you can improve your SSIS Data Flow Task easily just by setting AutoAdjustBufferSize Property of your data flow task. If you already know this, you can skip further reading.

    I already placed Balanced Data Distributors in my SSIS job, but the performance of Kingswaysoft CDS/CRM Component is not promising and too low.

    Thank you MalliKarjun Chadalavada for pointing me this.

    All you need to do is right click on your Data Flow Task..set AutoAdjustBufferSize to True and voila…there you go…

    Just test your SSIS job and notice the performance had been improved.

    Cheers,

    PMDY