Custom Controls in Dynamics 365 Business Process flows

Today I was just searching some stuffs on Custom Controls and then stumbled upon this link – https://docs.microsoft.com/en-us/business-applications-release-notes/October18/microsoft-flow/custom-controls-in-business-process-flows

Although the documentation tell that it is possible to embed custom controls in Business Process flow, it does not tell explicitly on how it can be done.

And finally after much searching I found it in Microsoft Flow Community blog – https://powerusers.microsoft.com/t5/Microsoft-Flow-Community-Blog

I could find some really wonderful posts there and I would sincerely suggest you to read this.

Now coming back to this article. I have been asked about how to put custom controls in Business Process flows for sometime by Customers but all this time I said “No it can’t be done”. But now we can do that. So without wasting more time let’s do it.

Let’s take the simplest business process flow here which comes OOB  – “Lead to Opportunity Sales process”.

image

As you can  see from the above screenshot, there is field called – “Estimated Budget” which is of type currency in the first stage of the business process flow which is Qualify. Normally this would render as a textbox in your business process flow. How about rendering it as more visually appealing control.

But wait you need to do bit of XML manipulation here. So let’s follow the steps.

  • Create a Solution
  • In the solution add the Lead Entity using “Add Existing” feature and add only the Lead form for the entity.
  • We all know that corresponding to each Business Process flow, an entity is created in CRM. Add the entity corresponding to our Lead to Opportunity sales process flow. The entity name will be same as the Business Process flow name.

You should should look like this.

image

Now I open the lead form in form editor. If you observe carefully, I have couple of field in the Qualify stage of business process flow that I will play with. One is the “Estimated Budget” which I mentioned earlier and the other is “Purchase Timeframe”

I put both the fields on the form.

image

I go to the field properties and change the control for Budget amount to Radial Knob and for Purchase timeframe to Optionset.

image

image

I save and publish the form. Now when I open the lead form, I could see the new controls on the form but the business process flow still shows the old controls.

image   image

So changing at the form level is not making the change at Business process level.

So let’s accomplish this. Export your solution as Unmanaged and once the solution is successfully exported, unzip your unamanged solution.

image

Three files as you can see. No surprise in this.

Open customizations.xml in an editor of your choice. What we will do hear is make the changes for budgetamount field in BPF but keep purchase timeframe untouched.

In the lead form xml of the lead entity search for “budgetamount” field.

image

The important thing here is the uniqueid highlighted in yellow. Make a note of that.

Now with the same uniqueid, search in your customization.xml file. You will find the custom control description for this budget amount field. Copy the controlDescription for this field. In my case it is as below

<controlDescription forControl="{0487895c-be18-985a-c3d4-1540e3d2ed86}">
                   <customControl id="{533B9E00-756B-4312-95A0-DC888637AC78}">
                    <parameters>
                      <datafieldname>budgetamount</datafieldname>
                    </parameters>
                  </customControl>
                   <customControl formFactor="0" name="MscrmControls.Knob.RadialKnobControl">
                    <parameters>
                       <value>budgetamount</value>
                      <min static="true" type="Whole.None">1</min>
                      <max static="true" type="Whole.None">100000</max>
                       <step static="true" type="Whole.None">200</step>
                     </parameters>
                  </customControl>
                   <customControl formFactor="1" name="MscrmControls.Knob.RadialKnobControl">
                    <parameters>
                       <value>budgetamount</value>
                      <min static="true" type="Whole.None">1</min>
                      <max static="true" type="Whole.None">100000</max>
                       <step static="true" type="Whole.None">200</step>
                     </parameters>
                  </customControl>
                   <customControl formFactor="2" name="MscrmControls.Knob.RadialKnobControl">
                    <parameters>
                       <value>budgetamount</value>
                       <min static="true" type="Whole.None">1</min>
                       <max static="true" type="Whole.None">100000</max>
                       <step static="true" type="Whole.None">200</step>
                    </parameters>
                  </customControl>
       < /controlDescription>

So we have copied the uniqueid value and the Control description.

Now within the entity of our Business process flow, you would find 4 tabs.

image

These tabs are nothing but stages of the business process flow. If you remember, the Lead to Opportunity sales process flow has four stage and hence four tabs. Also if we remember, our budget amount field was in the first stage – Qualify.

So expand the first tab and locate for the budgetamount field.

image

Put the uniqueid attribute as we copied earlier.

image

Now after the tabs section, place the customControlDescription that you copied earlier for budgetamount field. Please note it should be inside <controlDescriptions> tag.

image

All done. Save your customization.xml and re-zip your files. Import the new zipped file back to your environment. And now you can see the wonderful custom control in your Business Process flow as well.

image

You must be seeing Purchase timeframe is still rendering as regular optionset. The reason is we didn’t do anything for that field. We just modified the Budget amount field. Take it as lab exercise and do it yourself.

Wonderful isn’t it?

Hope this helps!

Debajit Dutta

(Business solutions MVP)

For consultation/ corporate training visit www.xrmforyou.com or reach out to us at info@xrmforyou.com or our training page http://www.xrmforyou.com/training-.html

Our product offerings:

Role based views for Dynamics 365 (http://www.xrmforyou.com/role-based-views.html)

CRM-Sharepoint Attachment uploader and metadata manager (http://www.xrmforyou.com/sharepoint-integrator.html)

Record Cloner for Dynamics 365 (http://www.xrmforyou.com/record-cloner.html)

Multiselect picklist for Dynamics 365 (http://www.xrmforyou.com/multi-select-picklist.html)

Advertisements

What is “Toast Notification Display time” in Dynamics 365

Well this blog is pure serendipity. I was doing something else when I discovered this sitting quietly in Dynamics (not sure when it came in) and then I explored it. What I am talking about here.

If you open a Unified APP, when you click on the small gear icon on the top right of your command bar, you would see an option – “Toast Notification Display Time”.

image

What is this exactly? If you read the whole word together, it may sound gibberish but it’s actually quite familiar if you in web designing and you know the term – “Toast Notification”.

So let’s break it – It is “Toast Notification” + “Display time”. So what is toast notification.

In UI (or I would say UX) world, toast notification is a small message that shows up in a box at the bottom of the screen (position may vary) and disappears on its own after few seconds. It is a simple feedback about an operation in which current activity remains visible and interactive.

If you carefully read the definition above and specially the one I have highlighted in bold, it is a notification or action message which is visible on the screen for few seconds only. But how much are these “few seconds”?

And that is where this setting comes into the picture.

If you click on that option, you would get the below screen.

image

Once you click “OK” on the above screen, you actually increase the notification timeout to 10 times its default.

So now I hope you understand what is this setting all about. But where in CRM where I can test this. Sometime the most obvious things that we see every day are difficult to re-collect when required.

We all have used the Quick create feature. When we create a record using Quick create, we get a notification “Your changes were saved” and also gives us an option to view the record.

image

Normally this notification would remain on the screen for around 8~10 seconds. However when this setting is enabled, this notification would last on the screen 10 times of the default time.

We understood the what and how part. But how can I leave my blog readers leave without understanding the “WHY” part.

This feature has been introduced by Microsoft to facilitate users with cognitive disabilities or users who take more time to comprehend and react to UI elements than average users.

P.S – This feature is only available in Unified interface. Enabling this has no effect on the Classic Web UI.

Hope this helps!

Debajit Dutta

(Business solutions MVP)

For consultation/ corporate training visit www.xrmforyou.com or reach out to us at info@xrmforyou.com or our training page http://www.xrmforyou.com/training-.html

Our product offerings:

Role based views for Dynamics 365 (http://www.xrmforyou.com/role-based-views.html)

CRM-Sharepoint Attachment uploader and metadata manager (http://www.xrmforyou.com/sharepoint-integrator.html)

Record Cloner for Dynamics 365 (http://www.xrmforyou.com/record-cloner.html)

Multiselect picklist for Dynamics 365 (http://www.xrmforyou.com/multi-select-picklist.html)

Multiple Document Location support, Ability to create folders, Support for delimiters–Introducing version 3.0 of our Sharepoint Metadata Manager and Attachment Extractor

Very excited to announce the release of Version 3.0 of our tool today. For trial and pricing, reach out to us at info@xrmforyou.com

What’s new in this version?

1. Support for multiple document location

Now our tool supports multiple document location for each record. By default, the documents are uploaded in the default document location. However user could go ahead and create a new document location for the record and upload.

image

image

New Document location Creation screen.

image

2. Ability to create Folders within a document location up to any level deep.

The tool now provides a feature to create folders in Sharepoint within a document location or within other folder to any level deep. This allows you to categorize your documents into document sets.

image

image

image

3. Support for delimiter(#) and % in folder and file names

Traditionally # has always been treated as a delimiter for URL and hence folder and file names with # in it were not allowed in it until recently when the capability was added to Sharepoint. Our tool now leverages it and allows users to create file and folder with #. Also the URL encoding escape character % is supported as well.

image

image

All this with the capability of Metadata upload, Multiple files upload, Drag and drop, automatic attachment extraction from notes.

image

For trial and pricing, reach out to us at info@xrmforyou.com

Debajit Dutta

(Business solutions MVP)

{Deep Dive} Dynamics 365 Portal authentication with Azure AD B2C Provider

Off late I have been getting loads of queries regarding this topic and whenever I get this one, I always provide the below link

https://docs.microsoft.com/en-us/dynamics365/customer-engagement/portals/azure-ad-b2c

However more often than not I find them coming back saying that even though they followed the entire documentation, they really could not make it work.

So finally I sat down went through the entire documentation, unraveled all the confusions and putting down this blog in the interest of my blog readers and community. I will keep it very simple with the minimal stuffs to make it work.

So let’s get started.

The first step is create a Azure AD B2C tenant. Please note you would need a valid Azure subscription to create a B2C tenant. I won’t explain the process here. It’s detailed in here.

https://docs.microsoft.com/azure/active-directory-b2c/active-directory-b2c-get-started

I create a Azure AD B2C tenant. Also I configured Customer self service portal. Details below

B2C tenant domain – xrmforyoub2c.onmicrosoft.com

Portal Url – https://powerappsyou1.microsoftcrmportals.com

Step 1: Register the Portal application in Azure AD B2C

Open your Azure AD B2C tenant

Click on Applications and Create a New application

image

Enter the details of the application as below

image

Name can be anything you want. I have put it as “Xrmforyou CRM Portals”.

Application type is Web App/ Web API

Set Allow Implicit flow = Yes

The final one is the reply URL – put it in the format of <portal url>/signin-<provider name>

Here in comes the main confusion. What is the provider name? Well you can say provider name is just a name you provide to identify your Login. I intend to use the phrase for the tutorial – “Azue AD B2C”. Reply URL here for me is <portal url>/signin-azure-ad-b2c (spaces replaced by –)

Once you save the application, you get a GUID In the application Id field. Copy and store it somewhere. We would need it soon.

Also copy the Reply URL. We are going to need it as well.

Step 2: Set up a user sign in policy in Azure AD B2C

Azure AD B2C is essentially an identity provider. Here you can define a User Policy which basically provides the identity provider, the claims and user attributes. It’s basically a way to define the identity provider which would validate the login, the attributes the user need to provide during the login process and the claims that will be passed to the application once the user successfully logs in.

In your Azure AD B2C tenant, select User flows (policies)

image

Click the “+” sign to create a New Policy

Select “Sign up and Sign In” from the below menu.

image

Enter a name and then in the Identity provider select “Email signup”. This basically allows the user to sign in/ sign up with their email addresses.

image

As we scroll below, comes one of the most important part of this process and that is selecting the User attributes and claims.

Before we go ahead and select some from the list, lets understand that when we think from the portal perspective, the important attributes when a user sign in are First Name, Last Name and most importantly the Email Address

So we will set up this policy in such a way so that when a user sign up using this policy in the portal, First Name, Last Name and Email address are automatically mapped to the newly created contact in CRM.

image

User Attributes are the one which are collected from the user when the user signs up first time in the portal

If you observe carefully, apart from First Name, Last Name, Email in the user attributes we have selected City, Country/ Region as well. We won’t be mapping them to the contact as of now but just to show that you can throw those up in the sign up page. We will see it in a short while.

Claims are the values about the user returned to the application once the user has successfully signed in. Here I just map GivenName, Surname and Emailaddresses (collection)

Go ahead and save the flow before we proceed with other stuffs.

Once the User flow is saved, Click on Properties

image

Navigate to the section “Token compatibilty Settings” and in the Issue claim, select the URL with tfp. Save the user policy.

image

The final step is to Run User flow

image

Click on the Metadata Endpoint as highlighted below

image

It will open the JSON definition of the end-point from where you need to copy issuer endpoint as highlighted below

image

Copy it and store it somewhere. We would need it later.

Step 3: Set up Site settings in Dynamics 365 Portal

So here we are in Step 3. And we really have done a lot through before reaching here. What we will do here?

If you remember, in the course of our journey we have collected three jewels along the way. One was the application id when we registered the portal in Azure AD B2C. Next is the reply url of the application. And the last one is the issuer id of the User policy from the previous step. We are going to need all those now.

So let’s get started

Go to your CRM –> Portals –> Site settings

Create the below records. Observe I have the phrase “Azure AD B2C” in the settings Name. This is nothing but the unique provider name (which can be any name as  I stated earlier)

Record 1:

Name: Authentication/OpenIdConnect/Azure AD B2C/Authority

Value: <issuer url of the policy>

Record 2:

Name: Authentication/OpenIdConnect/Azure AD B2C/RedirectUri

Value: <Reply url you configured while registering the application in Azure AD B2C>

Record 3:

Name: Authentication/OpenIdConnect/Azure AD B2C/ClientId

Value: <client id of the registered application>

The next set of site setting records need a bit of explanation. In our previous step when we created the User flow (policy), I explained you the user attributes and claims. Once the user signs up for the first time, the information captured in the user attributes are passed to portal as claims. But once the portal receives those claims, it should know which fields it should map to. The below site setting takes care of this.

Record 4:

Name: Authentication/OpenIdConnect/Azure AD B2C/RegistrationClaimsMapping

Value: emailaddress1=http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress,

firstname=http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname,lastname=http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname

As you can see, I have mapped the claims email, givenname and surname to emailaddress1, firstname and lastname fields of the contact respectively. To know more about claims and format please visit the below link. But for this tutorial, I hope this is pretty clear.

https://docs.microsoft.com/en-us/windows-server/identity/ad-fs/technical-reference/the-role-of-claims

If you want to map values even during sign-in, you just need to add another site setting record here.

Name: Authentication/OpenIdConnect/Azure AD B2C/LoginClaimsMapping

Value: emailaddress1=http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress,

firstname=http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname,lastname=http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname

Now as the user signs up to the portal using their email, it creates a contact record in Dynamics. Next time if there is another user sign-in with the same email, we should not be creating a new contact. We should associate the new sign-in to the existing contact. The below site setting will take care of this.

Record 5:

Name: Authentication/OpenIdConnect/Azure AD B2C/AllowContactMappingWithEmail

Value: true

Finally one are at the last site setting. And this is not mandatory one. But if your goal is that authentication through this Azure AD B2C should be the only way the user authenticates with the portal and no other method of sign-in is allowed, then the below site setting does exactly that.

Record 6:

Name: Authentication/Registration/LoginButtonAuthenticationType

Value: <your issuer url from the user flow>

All set-up and done. Now with the final test.

I browse my portal and click on Sign In.

This is the login page I get. As you can see, with the last site setting, we have disabled all other methods of registration.

image

In the above screen, we have two options. One to sign in and the other to sign up. Let’s first click on sign up.

We get the below screen.

image

So what are these fields. If you remember correctly, these are the same fields we selected as attributes in the User policy.

Once I complete my login process, I get the values mapped from claims for email, firstname and last name.

image

Awesome isn’t it.

Hope this finally gets it working for you.

Debajit Dutta

(Dynamics MVP)

For consultation/ corporate training visit www.xrmforyou.com or reach out to us at info@xrmforyou.com

Our product offerings:

Role based views for Dynamics 365 (http://www.xrmforyou.com/role-based-views.html)

CRM-Sharepoint Attachment uploader and metadata manager (http://www.xrmforyou.com/sharepoint-integrator.html)

Record Cloner for Dynamics 365 (http://www.xrmforyou.com/record-cloner.html)

Multiselect picklist for Dynamics 365 (http://www.xrmforyou.com/multi-select-picklist.html)

How to change Dynamics 365 CRM web interface from UCI to Classic version?

Very nice tip for many who may still need the classic UI

Arun Potti's MS CRM blog

Recently created a Dynamics 365 CRM 30 days trial version (Ref: How to Setup Dynamics 365 30 days Online Trial version?) and it was navigating to CRM home page showing the list of UCI Apps, instead of showing CRM Classic Web UI.

Below is the screenshot for reference.

Later found that, the rendered URL was showing differently in the browser and having forceUCI and pagetype parameters.

https://CRMOrgName.Region.dynamics.com/main.aspx?forceUCI=1&pagetype=apps

If you want to see the old Classic Version of CRM, just use the parameter forceClassic=1, instead of forceUCI=1 and remove the parameter pagetype=apps in the URL and final URL will be like the below,

https://CRMOrgName.Region.dynamics.com/main.aspx?forceClassic=1

Bookmark the URL and explore CRM 🙂

View original post

Understanding Data Loss Prevention policies in Power platform admin center

In my recently conducted training on Dynamics 365, I dealt a lot with the Power Platform admin center and could find that while there is great awareness of the CDS and how does flows and apps combine in to form a power platform environment, the concept of Data policies is something majority of the Dynamics population is unware of or may be not interested to learn.

But it’s lurking right there in the Power Platform admin center (https://admin.powerplatform.microsoft.com) and we can’t be ignoring it.

image

So let’s explore this.

If I click on the Data Policies link, I am taken to Power Apps Admin screen (https://admin.powerapps.com).

From there I create a New policy.

image

You would be thrown to the below screen. Basically this screen allows you to choose the environment where your Data Policy would be effective.

If you are a tenant administration, you will be able to see all the environments. Otherwise you would be able to see just the environment your are administrator of.

image

As you can see, I want to apply it to only one environment. I select the environment and then click on “CONTINUE”.

And then this is screen I am thrown to. It’s like an ocean of connectors right there and can get you puzzled. But in-fact its really simple

image

Basically as you can see from the above screenshot, there are two Groups – 1. Business Data only and 2. No business data allowed.

DLP’s are basically rules which define which combination of connectors you can use. It’s as simple as that. Still confused? Don’t worry I am here to help out.

I use the “Add” button in the Business data only section to add “Dynamics 365” and “Sharepoint” to it.

image

image

Now we have couple of connectors in Business data only and remaining in the No business data allowed group. Now when you go and design a flow, you won’t be able to mix the connectors between these groups. The below matrix would help you understand better.

image

Hope this makes it clear now.

I go ahead and save the policy. Now I create a flow in the same environment with Dynamics 365 connected to Notification trigger.

image

As you can see from the above screenshot, I can create the flow but the flow is in suspended state since it uses connectors across groups.

Hope this helps!

Debajit Dutta

(Dynamics MVP)

For consultation/ corporate training visit www.xrmforyou.com or reach out to us at info@xrmforyou.com

Our product offerings:

Role based views for Dynamics 365 (http://www.xrmforyou.com/role-based-views.html)

CRM-Sharepoint Attachment uploader and metadata manager (http://www.xrmforyou.com/sharepoint-integrator.html)

Record Cloner for Dynamics 365 (http://www.xrmforyou.com/record-cloner.html)

Multiselect picklist for Dynamics 365 (http://www.xrmforyou.com/multi-select-picklist.html)

 

Replicate Dynamics 365 Workflow Timeout wait condition in Microsoft flows

Lately working on Microsoft flows these days where I am helping my customer to migrate Dynamics 365 workflows to Microsoft flow. One of the workflow was using a timeout condition with  Duration Timeout as shown in the screenshot below.

image

I needed to replicate the same in Microsoft Flows. It’s quite simple and one of the most common requirements. Hence thought of blogging this one.

Basically there are two ways. One is using the Approval Trigger where you can set the timeout.

image

However Approval conditions of Flows are meant for specific needs and hence we won’t be using this one. So what is the other way? Let’s explore then.

I put a simple requirement here to test the timeout condition.

Create an account. On create of the account the flow fires. It waits for 2 minutes and then creates a Task record and associates it with the account.”

Very simple, isn’t it. So lets see.

The first thing is I initialize the variable. The variable type is of string and value I set to 2 minutes from current time.

image

The next step is to add the Delay Until condition and make the flow wait till the current execution time is equal to the variable we set earlier.

image

I end the flow with a create record step of Dynamics 365 which creates a Task record and associates it with the account record. Simple one and I am not showing it.

And below is the result when I run the flow.

image

As you can see, the Delay step waited for 2 minutes before it moved on the next step.

Hope this helps.

Debajit Dutta

(Dynamics MVP)

For consultation/ corporate training visit www.xrmforyou.com or reach out to us at info@xrmforyou.com

Our product offerings:

Role based views for Dynamics 365 (http://www.xrmforyou.com/role-based-views.html)

CRM-Sharepoint Attachment uploader and metadata manager (http://www.xrmforyou.com/sharepoint-integrator.html)

Record Cloner for Dynamics 365 (http://www.xrmforyou.com/record-cloner.html)

Multiselect picklist for Dynamics 365 (http://www.xrmforyou.com/multi-select-picklist.html)