Skip to content

benjaminjohn.de Posts

Bug in business process flows created before december 2016 update (CRM v8.2)

Posted in Dynamics 365, Power Platform, and Revive

Microsoft has intoduced some really nice features with Dynamics 365 (CRM v8.2), but also a bug for business process flows of existing customers created before the december 2016 update. This causes an error message on switching to another business process flow or the completly disappearance of the business process flows from the form.

Jiří Pešík has already blogged a method to identify and resolve the issue, but from my point of view it is not cloud suitable and not supported,because there are changes made directly on the database.

Cause

With the new features came also new fields in the system. Unfortunately they haven’t been filled during the update for already existing business process flows. One of them is the required field “uniquename” of the “workflow” entity. You can even see it when open the details pane of the new business process flow editor.

Identification

You can use a simple query in the advanced find to identify concerned business process flows.

Resolution

Is just as easy as the identification. Deactivate your business process flow and the system will fill the name automatically and you can activate it again immediately. No code, no sql, just magic. 😉

Disabled “From” field on email entity

Posted in Dynamics 365, and Power Platform

After an update to Dynamics CRM 8.1.0.359 it happens that the “From” field of the email entity is permanently disabled / locked on all forms, even in the workflow-editor.
It seems as the updates deletes a part of the fieldsettings. But you can easily restore the settings.

  1. Create a new solution with the “From” field of the email entity in it.
  2. Export the solution, unzip it and open the customizations.xml.
  3. Find the tag:
    <LookupTypes />
  4. Replace it with:
    <LookupTypes>
       <LookupType id="00000000-0000-0000-0000-000000000000">8</LookupType>
       <LookupType id="00000000-0000-0000-0000-000000000000">2020</LookupType>
    </LookupTypes>
  5. Save the customizations.xml and zip it again into the solution file.
  6. Upload and publish the updated solution.

All credits go to the people of the following threads. They found and tested the solution.

Empty pipelinephase on opportunity quickcreate

Posted in Dynamics 365, Power Platform, and Revive

You all know the most common usage of the pipelinephase field of an opportunity. It’s the sales funnel chart in sales dashboards.
By default the pipelinephase field is filled with the number of the current business process, followed by its name. But sometimes it stays empty. You can imagine how unhappy the sales guys are about that.

What I found out

It depends on how you create the opportunity. If you create an opportunity through the quickcreate feature, where it does not matter if you use the global “+” sign or the contextual “+” sign of a subgrid to create it, the pipelinephase field will not be filled until you step further in the next phase.

Workaround

Build an asynchronous workflow on opportunities that is triggered on create and fills the pipelinephase field if it is empty.

Below you find a solution to download that contains this workflow. It takes dynamically the phase name of the current business process. It is also an ondemand workflow, so that you can run from a view or advanced find that shows you all open opportunities with an empty pipelinephase field.

Issue reporting

There is already an proposal on CRM-Ideas for this issue. You can find it H E R E. It is already 9 month old and has only 4 votes. My appeal to you, follow the link, sign in and vote for it. The more votes it get, the higher is the attention from Microsoft.

Limits for custom parameters

Posted in Dynamics 365, and Power Platform

Have you ever asked how many characters you can pass as parameter to a Javascript event handler or to a HTML webresource? I do, because I like to give a consultant or the customer the possibility to pass dynamic values in form of JSON objects or even whole functions without touching my code.

HTML webresource

The limit here is at 1.500 characters.

Javascript event handler

I think there no limit. Really. I made a test with up to 2.400.000 characters without any problems. The only thing that I would mention – do not exaggerate it as I did, because the performance suffers quite a lot.

Internet Explorer and promises

Posted in Dynamics 365, Power Platform, and Revive

Microsoft shows us on Get started with the Microsoft Dynamics 365 Web API (client-side JavaScript) how to create a re-usable function using promises. Between the description and the example is a little note box that points out that Internet Explorer 11 doesn’t implement native promises. Most other browsers support promises natively, IE is the problem child – again.
Microsoft further advises that there are several polyfills and libraries which will implement promises to IE. But they don’t tell you how do this in an effective way.

Detection

As you don’t want to add and load superfluous libraries, you have to detect if the browser has promises implemented. In my first approach I used modernizr. 2KB more just for detection. That is not what I wanted and searched for a plain js solution and found it at stackoverflow.

if(typeof Promise !== "undefined" && Promise.toString().indexOf("[native code]") !== -1)
{
    //Your browser is unsuspecting, paste your polyfill or library here.
}

Agony of choice

Now that we can detect if the browser has implemented promises or not, which polyfill or library should we implement additional? My decision fellt on the smallest possible solution I found – ‘ES6 Promise polyfill’ with only 2KB.