Here is how you can quickly call action using Web API, with this method you can execute a single action, function, or CRUD operation. In the below example, let’s see how you can call an action. Here is function…to achieve this..
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This example details with Unbound action, which is not tagged to any entity, however if in case on Bound action, you will specify the entity name for bound parameter instead of null. You need to specify the Metadata accordingly for your Action. Let’s understand it’s syntax first…
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.
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.
This post is for all who are working on D365 Model Driven Apps and mainly Plugins.
Yes, you saw it right, in this blog post, we will see how can debug plugin without using our favorite plugin profiler which is very widely used from quite some time by everyone working on Plugins for Dynamics 365. All this is done by a tool called Dataverse Browser, which is not yet on XrmToolBox. Please note that there were some limitations as detailed in limitation section below.
Here are 3 simple steps to follow..
Install Dataverse Browser
Attach the Debugger
Run your actual operation.
Step into your code and debug it.
The tool embeds a web browser based on Chromium. It works by translating the Web API requests to SDK requests. Then it analyzes if plugin steps are registered on the message and it loads them, make them run locally. All other requests are sent to the Dataverse, so that the plugins are interacting with the real database.
Download the latest source code of Dataverse browser here.
Next extract the zip file downloaded as highlighted below
Extract the zip file downloaded, open Dataverse.Browser Application as highlighted below.
In the popup window, click on More info as highlighted below…
Then run the application anyway…you will be presented with a window where you can select the environment. Going forward, any time you want to open Dataverse browser, just open the Dataverse.Browser.exe and choose the environment as below.
Click on New, enter the details as above and key in the details.
Enter the settings of your environment:
A name meaningful for you
The host name of your instance (without the https://)
The path to the plugins assembly file (the dll). For a better experience, it should be compiled in debug mode with the pdb file generated.
Then click Go.
You just need to Authenticate to your instance.
Once Authenticated to the respective model driven apps, all the Web API requests sent to Dataverse will be shown as below.
I have following Plugin Libraries registered.
Next step is to choose the instance and perform the respective operation which triggers the Plugin. So, in here, I will perform an update to the Account entity from the Dataverse Browser which triggers the Plugin.
Once an update is performed, a Web API request gets recorded in the Dataverse browser as highlighted below.
Since the Plugin is in Post Operation, i.e. Stage number is 40
Just expand the Patch Request, you should see two operations on 30, 40, but area of interest here is for the Plugin which was registered on stage 40.
Make sure you open the Visual Studio and perform the below steps from Dataverse Browser.
Attach the debugger from Dataverse Browser by clicking on the Plug Symbol as below which will show the list of debugger options available for you to select from. Here I have selected Execute Plugins, plugin will be invoked. You can either select any of the three options as presented below.
1.Do not execute plugins – recommended when you want to debug without actually triggering your plugin logic. i.e. With this approach even you can check the code in Production environment.
2. Execute plugins/Execute plugins with auto break – recommended when you want to debug by triggering your actual plugin, this is recommended in case your plugin code had changed recently and in Development environments.
Just select Ecellors Demo – Microsoft Visual Studio: Visual Studio Professional 2022 version which will launch an existing Visual studio 2022 as below in break mode. Next click on Continue as highlighted below or press Click F5 on your keyboard.
This shows you that the debugger has been attached when you navigate to Dataverse Browser asking you to place your breakpoints.
Now just place breakpoints in your code in Visual Studio. Just go back to Dataverse Browser and click on Ok on the Diaglog box.
Perform the operation which triggers the Plugin from Dataverse Browser itself, this will hit the break point in Visual Studio from where you can debug your plugin.
As you might have observed, your code need not throw exception in order to debug, you could do similarly to the way you would debug using Profiler. But here just that you don’t need to deploy the latest code to the Dataverse just for debugging purpose.
This gives a lot more flexibility eases the way you debug plugins.
Limitions:
There is no support for transactions.
When plugins are triggered because of a server-side operation, they will not be run locally.
For many reasons, behavior will never be perfectly similar to the one when plugins are executed on server side.
Happy debugging, I hope you found this post useful…
In this blog post, let’s see how we can create a custom connector without leaving our own Visual Studio for building a custom connector. Ideally for building any custom connector, we need to create them in https://make.powerapps.com or https://make.powerautomate.com. Last month Microsoft Announced that Power Platform is now a connected service in Visual Studio 2022. In this blog, we will utilize its capability…
Before diving deeper, let’s see what are the prerequisites..
Visual Studio
ASP .NET Web API knowledge
Canvas Apps knowledge
Let’s get started..
Step 1:
Create ASP.NET Web API Project in Visual Studio
Step 2:Choose your option as below and click on Next..
Step 3:
Choose your next steps as below and click on Next to proceed, make sure to choose authentication type as None
Step 4:
Create a ASP.NET Core Web API Project
Step 5:
By adding Power Platform as a service dependency, you can update an existing custom connector, or create a new one from your API.
If you want to expose your local running API to a public endpoint, I prefer using Dev Tunnels feature of Visual Studio…
That’s it, you have started running your API.
Step 6:
Now let’s create a Mobile App with Power Apps…with the same login you have used for the Visual Studio to create a custom connector..
Step 7:
First check if Custom Connector has been created in your tenant and authenticate the connection….navigate to https://make.powerapps.com and click on Discover at the left of the page….and then click on Custom Connectors, you should see a connector which we created from Visual Studio….nice isn’t it…
Step 8:
All you need to create a connection by clicking on the + sign available..
Once connected, now try creating a mobile Canvas App..
In the Canvas App, try adding data…and search for Weather Sample which you created, you should see something like below…
Step 9:
Once the web API is running in your development environment, you can debug in real time and even Hot Reload your code.