Tip #819: Project Services Lead to Opportunity

Today’s tip is from Matt “Almost Resident” Johnson.

I recently came across this little conundrum when progressing a Lead through to Opportunity. Maybe this will save someone else a head scratching moment or two.

If you convert a Lead to Opportunity by pressing the Qualify button. It will work but the Opportunity it creates will use the “Opportunity” form which doesn’t have all the Project Service functionality on it, even if you’ve got the “Project Information” form set as your default. If you try and change the form to the “Project Information” form, it will just jump right back to the “Opportunity” form.

Turns out there’s a new field on near the bottom of the Lead form in Details section called Type. You need to change that to “Work based” and then when you Qualify the Lead it will use the correct “Project Information” form.

PSA lead to opportunity

Hope that helps someone.

It most certainly will! – t.j

Tip #818: Quick surveys using Microsoft Flow

Surveys are a tricky business. Make them too long and people won’t fill them in, make them too short and you won’t collect the information you are after. However, in customer service, surveys can be conditional. First, we ask customer if they are happy with the support received. If yes, there is nothing more to ask, if not, we can follow it up using perhaps another survey, or email, or even a phone call.

For the “binary” surveys we could use Voice of the Customer, or a custom web page, but Microsoft Flow provides a nice and easy way to solicit responses using Approval Emails.

Let’s create a flow that waits for the cases to be resolved:

Flow - case resolved

If case was resolved, figure out the email address by querying the contact record and send approval email asking customer how did we go.

Flow - send approval

When Send approval email step is executed, the customer receives an email and the flow pauses waiting for a reply:

Flow - approval email

Clicking through will generate a message for the customer and the flow will continue its execution:

Flow - thank you

I wouldn’t push the envelope trying to solicit more choices from the customer but as a nice and easy binary response system it does the job surprisingly well. What’s still unclear is for how long flow will wait for a response (that may never come) – I didn’t find any easy way to introduce parallel wait. Perhaps some kind of twisted Do Until construct?

Tip #817: Display knowledge articles in the portals using custom templates

Dynamics 365 portals come with a specially crafted pages for browsing Knowledgebase Articles by category as well as for displaying the content. KB content page is based on a rewrite-style template and is not customizable.
It’s not difficult to put together an entity list and entity form to display the list of the articles and their content, however, the HTML content will be displayed:

HTML encoded

The reason is that entity forms in portals use textarea element to render the multi-line text content and the result, of course, is encoded.

There are two ways to solve the issue and get the content inline:

Do not define Details button for entity list that displays an overlay form. Instead, simply provide Web Page for details view. For that page use one of the liquid templates, e.g. Full Page Without Child Links and then insert the article by using liquid directly into the page content:

{% assign id = request.params['id'] %} 
{% assign kb = entities.knowledgearticle[id] %} 
{{ kb.content }} 

Knowledge article will be displayed in a separate page that portal will navigate to when you click the article number in the list.

If you insist on using overlay form, the solution is to replace <textarea> with a <div> element using javascript that you can define in the Custom JavaScript field:

$(document).ready(function() {
  var ctrl = $("textarea#content");
  var div = $("<div>").html(ctrl.text());
  ctrl.replaceWith(div);
});

Result:

HTML decoded

Tip #816: Dynamics 365 SSRS reports on iPad

A few years back while writing the CRM Mobile Survival Guide, I found that SSRS reports could not be run on mobile, even when viewing CRM via the tablet browser experience. Unless you took several extra unsupported steps such as tricking Safari into thinking it was a desktop browser.

In my tests of Dynamics 365 on mobile, I have found this to no longer be the case. If you open the Dynamics 365 app and click the “open in browser” button, the tablet browser experience now no longer hides the “Run Report” option. This means that you can now run your SSRS reports without having to jump through a bunch of unsupported steps.

 

Tip #815: Make your Dynamics 365 portal speak local language

Swedish ChefAs of the time of writing, Dynamics 365 supports 45 languages. But there is only one English, one Spanish, and one French (to name a few) which makes people in UK, Australia, entire South America, and Canada fairly disappointed, considering that the list of locales contains about 230 entries.

We learned to deal with the absence of the localised flavours in Dynamics 365 but, as it turned out, we do not have to when it comes to the portals. Portals for Dynamics 365 have been released in 43 languages (all supported sans Arabic and Hebrew), and the process of enabling content in another language is straightforward:

  1. Enable additional languages in Dynamics 365
  2. Navigate to Portals > Websites in Dynamics 365 and open the Website record. Add Website Language record under Supported Languages
  3. All applicable entities, e.g. web pages, web link sets and content snippets, will now have multi-lingual content available

But, wait, there is more! When you add a Website Language record, language lookup field comes from the Portal Languages entities.

  1. Navigate to Portals > Portal Languages
  2. Add new record and enter the data for the localized language.
    Language of Australia
  3. The fields are as following:
    • Name: whatever you feel like
    • Display name: this part will be visible in the language selector
    • Description: meaningful one, of course (but nobody will ever see it)
    • Dynamics 365 language: this one is important. Must match one of the 43 supported languages
    • LCID: valid .NET language locale identifier (see the link to the list above)
    • Code: this will form part of the URL, as in
      https://contoso.com/en-AU/about-us
  4. Once language is there, follow the steps above to add it to the list of the supported portal languages.
  5. Deliver your content as required in the worlds of organisations, colours, and sebras.
    Portal language selector

Can’t wait for our Nordic friends to start delivering portals in sv-BORKBORK.

Tip #814: Setting Regarding field in Microsoft Flow

When you use Microsoft Flow to create a Dynamics 365 activity record, e.g. task, it’s a good practice to relate the activity to another record by setting up Regarding field.

Use dynamic values and drop the related record into the Regarding box, right? If you do just that, your flow may fail with the following error

Body
{
  "status": 400,
  "message": "Ambiguous binding is present. 
             Resolve by sending lookup_type property.",
  "source": "127.0.0.1"
}

Aha! – you say, I noticed there is a Regarding Type field right next to Regarding so I just set that one and be done. But what do you need to set this field to? incident? 112 (entitytypecode value)?

Under the hood Microsoft Flow uses Web API to communicate with Dynamics CRM and, sadly, the decision was made to use plural names in Web API. So the correct value is incidents.

Set regarding field in Microsoft Flow

Task will be created, linked to the case, and they will live happily ever after.

Tip #813: Renaming default app

I couldn’t believe that there is something in Dynamics 365 world that Scott “Mr. Ribbon Workbench” Durow doesn’t know!

Scott

When importing solutions from 8.1 into 8.2 or upgrading orgs – is there a trick to rename the default app from ‘Dynamics 365 – custom’ to something else without having to create a new app?

In the short term I have customers who don’t want to us the separate App sitemaps – and want to stick with the ‘old’ single site map – however they don’t like seeing ‘custom’ in the name.

I know that https://www.microsoft.com/en-us/dynamics/crm-customer-center/business-apps-in-dynamics-365.aspx describes this ‘custom app’ providing ‘access to the full suite of capabilities’ but all we need to do is drop the ‘custom’ bit from the name!

First to the rescue Andre “I’ve got 88 in my handle” Margono

Andre

If my memory serves me right, there is a settings under system settings to rename this default app.

Default app name

Settings > Administration > System Settings, and tucked at the very bottom, to be precise – t.j.

Tip #812: CRM Undo

Occasionally I get the question, does Dynamics CRM/365 include an undo/redo feature.

While the application does not have an undo button, it does support the features of your operating system, and if that OS is Windows (any version), you can use the keyboard shortcuts CTRL+Z to undo, and CTRL+Y to redo.

Note that this is limited to undo/redo in the current field. It’s useful if you overwrite a field value by mistake, but keep in mind that if I tab or click to another field, it won’t undo what I did in the previous field.

Tip #811: Multilingual portals and external authentication providers

After on and off hiatus caused by the festivities season we are back with another annual round of the daily tips.

If you have external authentication providers all worked out in your Dynamics 365 Portal, and then you enable multilingual feature so that your portal looks fine in, say, Kazakh (yes, it’s one of the officially supported 43 languages), you may find that the content now would have a different URL depending on the language. For example https://foobar.com/contact-us would become https://foobar.com/en-US/contact-us or https://foobar.com/kk-KZ/contact-us, depending on your audience choice.

That URL change will break authentication with the external providers and users trying to logon will see Page Not Found with the URL resembling https://foobar.com/en-US/signin-microsoft?code=etc.

Solution:

  1. Change site setting MultiLanguage/DisplayLanguageCodeInURL to False. That will ensure “old-style” navigation with the current language passed around in a cookie instead of a URL.
  2. If you are keen to retain language identifiers in your URLs, change callback/redirect URL on your provider side to include the code of any of the supported by your portal language code, e.g.
    https://foobar.com/kk-KZ/signin-microsoft, add the site setting
    Authentication/OpenAuth/Microsoft/CallbackPath and set it to
    /kk-KZ/signin-microsoft

 

Tip #810: Using Fiddler with Xrm Tooling

Sometimes it’s very useful to see what requests are flying forth and back between your code and Dynamics 365. The tool of trade is, of course, Fiddler. Fiddler allows https traffic analysis by using man-in-the-middle interception using self-signed certificates.

If you are using Xrm Tooling and, specifically, CrmServiceClient then you quickly find that the following code:

var s = 
 @"Url=https://a.crm.dynamics.com;AuthType=Office365;
   UserName=foo@a.onmicrosoft.com;Password=strongone";

using (var crmSvc = new CrmServiceClient(s))
{
   Console.WriteLine($"{crmSvc.IsReady}");
   if(crmSvc.IsReady) 
   {
      Console.WriteLine(
      $"{crmSvc.ConnectedOrgFriendlyName}");
   }
   else 
   {
      Console.WriteLine("Doh!");
   }
}

generates a friendly “Doh!” instead of a friendly organization name.
The logs will show the following error: The remote certificate is invalid according to the validation procedure, and it’s fair enough as Fiddler certificates are self-signed.

If you do want that trace, there is a silver bullet and a brilliantly concise gun to fire it. Just add the following code before creating CrmServiceClient:

ServicePointManager
   .ServerCertificateValidationCallback +=
   (sender, cert, chain, sslPolicyErrors) => true;

Happy debugging!