Fixed – Object reference not set to an instance of an object error while calling an Action in Dynamics 365


Recently in one of our JavaScripts which was calling an action (with a plugin registered to it) was giving us the below error.

We had a plugin registered on the call of that action, which in turn was calling an external service.

We figured out the probable cause of this error (related to certificates) and updated the plugin code accordingly on the server.

Unfortunately, this didn’t fix the issue for us, we also tried different possible solutions but to no avail.

As a last resort, we thought of giving this a try – deactivate and activate the Action, and to our surprise that did the trick.

Our thought is maybe Action was somehow still referring to the old plugin code, and the step of deactivating/activating the Action kind of cleared the cache or something, making action to refer to the latest plugin code deployed.

Hope it helps..

Advertisements

Fixed – Column names in each table must be unique. Column name ‘x’ in table ‘y’ is specified more than once while importing solution in Dynamics 365


Recently while trying to import the solution we got the below error.

Below was the outcome of our analysis

  • The column or the field referred to in the error message was not available in the CRM application i.e. customizations – default solution was not having this attribute.
  • The column was only available in the base table of the entity.
  • The column was not available in the filtered view of that entity.
  • The column was not available in the MetadataSchema.Attribute table.
  • We had around 50 such columns in the base table of the entity.

In short, the field was only available in the base table and wasn’t available anywhere else, which could have been the result of the solution being deleted at some point in time, followed by the wrong restoration of the table (i.e. unsupported change to the database).

We raised the Microsoft Support for the same, and the way we resolved the issue was by dropping/deleting those columns from the base table, followed by running the solution import which went successful this time. (fortunately the fields were all blank – null or default value)

ALTER TABLE “table_name” DROP “column_name”;

We can also get this error if we have a field with same schema name as source field created in the target environment (created manually / directly there). In this case also either we can remove the field from the source environment’s solution file or we can delete the field from the target environment.

Hope it helps..

 

Pause and resume enhancements in SLA in Dynamics 365 – 2020 Release Wave 2


The way we currently configure Pause and Resume for an SLA is by setting the Allow Pause and Resume field to Allow.

And within the Service Tab of System Settings, we can define the status values on which the SLA calculation should get paused at the entity level.

So basically, the SLA will be paused for the case record with status as either On Hold and Waiting for Details as we have defined below.

As soon as we change the status to Researching, the timer resumes

With 2020 Release Wave 2, we can now configure Pause Criteria at the SLA Item level, which overrides the criteria defined at the SLA / Entity level as defined above.

Toggle Override Criteria field

We can define the criteria as shown below using the condition builder.

Here we have defined the condition for SLA to be paused in case of case type Request.

Save and activate the SLA.

Let us now create a new case to see it in action.

We can see the SLA timer running.

Update the case type to Request and save.

As expected, we can see the SLA paused

Check other blog posts on Release 2020 Wave 2

Hope it helps..

Sub grid and form tabs improvements in Power Apps Mobile App


There are couple of improvements in user experience for sub grids and form tab in Power Apps Mobile app.

Check other blog posts on Release 2020 Wave 2

  • Headers are more protruding for sub grid to separate it from rest of the sections of the form.
  • There is also an option (+ New Case – below) to add new record inline for empty sub grids.

  • Commands on sub grid opens as a drawer from the bottom of the screen.

  • Form tabs can be scrolled horizontally and selecting the tab automatically adjusts the header.

Hope it helps..

Use custom browser protocol to launch desktop applications from Dynamics 365


Recently we had a requirement to launch a .NET desktop application installed in the user’s machine from within Dynamics 365 and also pass parameters to it.

One of the ways of implementing is by using the Custom URL Protocol.

Modern browsers and operating systems allow us to implement a custom URL protocol and register an external application to handle it. So when a user clicks  on the link that uses that custom URL Protocol, the browser will open the application that is registered.

Check a few examples here

https://docs.microsoft.com/en-us/windows/uwp/launch-resume/launch-app-with-uri

So, let us start and register our Custom URL Protocol.

Below is the source code for creating a new key


var applicationPath = @"C:\MyParamApp\MyApp\bin\Debug\MyApp.exe";
var KeyTest = Registry.CurrentUser.OpenSubKey("Software", true).OpenSubKey("Classes", true);
RegistryKey key = KeyTest.CreateSubKey("OpenAppP");
key.SetValue("URL Protocol", "OpenAppP");
key.CreateSubKey(@"shell\open\command").SetValue("", "\"" + applicationPath + "\" \"%1\"");

Here OpenAppP is the protocol name and the application path that holds the path of application that we want to execute.

For key.CreateSubKey we have specified %1 for passing the parameter.

If we do not want to pass the parameter then we do not need to append it.

On running the above code, we can see the key added with the value specified

Below is the source code of our console application, basically it reads and writes the parameter in the output window.

Below is our Html page that we will call from within a button on a form from Dynamics 365 and which will open the MyApp.exe in turn.

Here we have published the page in Azure.

The html page on onload will retrieve the id query parameter and append it to the link for the custom protocol

OpenAppP:id

Back in CRM, we have a custom ribbon button named Open Console App added with the following definition.

Url Command Action and Crm Parameter in it to pass the id.

Clicking on the button

as expected, opens the alert along with opening the console app with the parameter passed to it.

Get more details

https://www.vdoo.com/blog/exploiting-custom-protocol-handlers-in-windows

Hope it helps..

 

Advertisements

App Switcher, Back option and other changes in Dynamics 365 – 2020 Release Wave 2


Below are some of the updates in the product as part of 2020 Release Wave 2.

  • To switch between the Dynamics 365 Apps, we need to click on down arrow icon next to Dynamics 365.

With 2020 Release Wave 2, we can click on the app name i.e. which opens up the pop-up windows listing all the apps.

We can search, create a new app, assign roles, filter etc.

Earlier to access the same we had to navigate to Advanced Settings à Apps

  • Next is the change in the Breadcrumb navigation

Is now seems to be replaced with the back button functionality

  • Also the User Account menu has also been updated earlier,

and now in 2020 Release Wave 2

View account takes user to the My Account page in Office 365

MyAccount

Check other blog posts on Release 2020 Wave 2

Hope it helps..