How to – Create an Instant low-code plug-in (Dataverse) (experimental)


Low-code plug-in is a new experimental feature released by Microsoft, for early adopters, not meant to be used in production. As per Microsoft, “the experimental features can change radically or completely disappear at any time“.

There are 2 types of low-code plug-ins we can write – Instant and Automated.

Instant plug-ins are triggered manually and support parameters, whereas automated plug-in as the name suggests, runs when a particular event (create, update, or delete) occurs on a table and they do not support parameters.

As a prerequisite, we need to first install the Dataverse Accelerator

We can install it from Admin Center >> Resources >> Dynamics 365 Apps

Or from the App Source, look for Dataverse Accelerator and click Get in now.

https://appsource.microsoft.com/en-us/product/dynamics-365/microsoftpowercatarch.dataversekit1?exp=kyyw

Specify the Environment to start the installation. (Should take around 5 minutes)

Open the Dataverse Accelerator App.

Click on + New plugin for the Instant Plugins

Provide the display name and the description for the plugin, and also select the appropriate solution.

We can specify optional Input and Output parameters along with the Expression that uses Power FX formulas to define the logic for the plugin.

Our sample plugin takes City as the Input Parameter and returns the total number of contact records having that same city.

Save the plugin and click on Test.

Provide the value for the input parameter and click on Run.

We can see the status as Success and the output parameter Result having a value of 4.

This completes our plugin.

Now to use it, click on the Integrate tab.

The tab provide us the required details.

We can copy the Power FX expression and use it inside the Canvas App.

We get the output as expected.

Below we are calling it from within the Power Automate Flow from a Perform an unbound action

The result –

Get more details and Check out the known limitations

Hope it helps..

Advertisements

Send bulk email / direct email to Customers – Dynamics 365


To enable the option of sending bulk email / direct mail in Unified Interface, we can navigate to Settings >> Administration >> System Settings >> Email >> Enabled Send Direct Email Action in Unified Interface

Now on selecting the record(s) of email enabled table, we get the option “Send Direct Email”

We can also specify the Email Template and preview the content before sending.

We can see the mail received in the Hotmail account from the CRM user’s email id/mailbox configured.

Here the end-user has also replied to the email.

We can see the response / reply automatically “Tracked to Dynamics 365” in the CRM user’s outlook. (based on the CRM user’s Personal Options setting)

Which creates Email activity (closed status) in the corresponding contact record inside CRM.

More on Tracking Email

Hope it helps..

Advertisements

Fixed – The domain where this form is embedded might not be enlisted as a domain record for externally hosted forms in Dynamics 365 Marketing


Recently we were getting the below issue for our Marketing Forms hosted on an external website on a particular authenticated domain. The pages were working fine in other authenticated domains.

The domain where this form is embedded might not be enlisted as a domain record for externally hosted forms. Otherwise, a browser extension or plugin may be blocking this form from loading. Review and reload form to continue.”

This particular domain was also shown as authenticated in our Dynamics 365 marketing.

Our website was e.g. https://www.domain.kiwi/ so we had domain.kiwi authenticated in Dynamics 365 Marketing.

Eventually, we had to raise a Microsoft Support Ticket and were instructed to add/ authenticate www.domain.kiwi   (with www.) also, doing so resolved the issue for us.

Also, there seemed like a UI bug in the Marketing which will cut out “www.” automatically when trying to authenticate the domains.

Hope it helps..

Advertisements

Interesting articles on Plugin behavior – Dynamics 365 / Dataverse


Found below interesting articles, do check out- 

Can we create child records in Pre-Operation Plugin?https://community.dynamics.com/forums/thread/details/?threadid=1e757e7a-60b2-4fc6-9a94-acea44b18f8c

What happens when we use ExecuteMultiple within Plugin?https://www.inogic.com/blog/2015/11/executemultiple-workflow-or-plugin-assemblies/

Advertisements

Missing dependencies – You’ll need to import the following items to this environment error while importing the solution – Dynamics 365 / Dataverse


Recently while trying to import one of the solutions we got the below error

Missing dependencies. You’ll need to import the following items to this environment.

It was referring to one of the Managed Solutions – DynamicsMKT_PushNotification, managed by Microsoft, for Microsoft Dynamics 365 Marketing.

We realized that the source environment had a higher version installed than the destination environment.

Source – 1.1.25335.61 and destination environment – 1.1.22667.44

Initially, we thought the error is because the Dev had full marketing app configured i.e. both Solution and Services app configured and the destination had only Dynamics 365 Marketing Solution Only app.

The marketing apps –

After raising the Microsoft Support, we got guidance/advice from the Microsoft Support / Product team that the Dynamics 365 Marketing Solution Only app was not installed in the destination environment and it was a copy of some other environment that had marketing installed. They suggested installing the Dynamics 365 Marketing Solution Only app in the destination environment. After installing the app, we could see the version of the DynamicsMKT_PushNotification solution increased and were able to install our custom solution successfully.

Hope it helps..

 

Advertisements

Sample Code – Enable / Disable Plugin Step (sdkmessageprocessingstep) Dynamics 365 / Dataverse


Recently we had to disable plugin steps as part of data migration, below is the sample code we can use, either specify the name of the assembly, plugin, or plugin step as we are using the “begins with” condition or make changes as required.

 class Program
    {
        static void Main(string[] args)
        {

            const string ConnectionString = "AuthType = OAuth; " +
                                            "Username = Nishant.Rana@xyz.com; " +
                                            "Password = testxyz; " +
                                            "Url = https://orgname.crm6.dynamics.com;" +
                                            "AppId=51f81489-12ee-4a9e-aaae-a2591f45987d;" +
                                            "RedirectUri=app://58145B91-0C36-4500-8554-080854F2AC97;" +
                                            "LoginPrompt=Auto";


            CrmServiceClient svc = new CrmServiceClient(ConnectionString);

            if (svc.IsReady)
            {
                try
                {
                    // we can specify step / plugin / assembly name
                    var pluginStepAssemblyName = "MyD365.Plugins.Core.Plugin.AssignOwner";
                    // 0 for active and 1 for inactive
                    var pluginStateCode = 0;                   

                    var query = new QueryExpression("sdkmessageprocessingstep");
                    query.ColumnSet = new ColumnSet("name", "sdkmessageprocessingstepid");
                    query.Criteria.AddCondition(new ConditionExpression("name", ConditionOperator.BeginsWith, pluginStepAssemblyName));
                    var sdkMsgProcessStepCollection = svc.RetrieveMultiple(query);

                    foreach (var sdkMsgProcessStep in sdkMsgProcessStepCollection.Entities)
                    {
                        var setStateRequest = new SetStateRequest();
                        setStateRequest.EntityMoniker = new EntityReference("sdkmessageprocessingstep", sdkMsgProcessStep.Id);
                        setStateRequest.State = new OptionSetValue(pluginStateCode);
                        setStateRequest.Status = new OptionSetValue(-1);
                        svc.Execute(setStateRequest);
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Exception Messainge : {0} ", ex.Message);
                }

            }
        }
    }

Hope it helps..

Advertisements