Wednesday, June 28, 2017

Install the LinkedIn Sales Navigator to Microsoft CRM Dynamics 365 Online


Pre-Requisites:


  1. D365 CRM Online Environment
  2. MSDynamics 2016 and 365 Widget Rar File.

Procedure:


The following are the steps to Install the LinkedIn widget to Microsoft CRM D365

Step1: The user will have to download the zip folder from the following LinkedIn website link. Do not unzip the folder as we need to import the solution as it is to the D365 CRM Environment.

For downloading the zip folder use the following link and save the zip folder to a particular folder.
https://www.linkedin.com/help/sales-navigator/answer/78963

Click on the zip folder download link as shown in the above image.

Step 2: Now the user will have to go D365 CRM and on the ribbon, go to Settings> Solutions as shown below

On the solution page select ‘Import’ option

Browse for the solution file that we had previously downloaded and click on ‘Open’ then ‘Next’

In the next window the user will get the information of the solution.

The user can view the information by clicking on the ‘View solution package details’.

lick on Next to proceed ahead.

Note: User will have to check the ‘Enable any SDK message processing steps included in the solution’ if it is unchecked, click on the Import option

A dialog box will pop up showing progress of the import. Once the importing has finished click ‘Next’.

A summary window will display all the imported components, indicating the solution import.

Step 3: The last step of the installation process is to assign all users a ‘LinkedIn Configuration’ security role to give them access to the integration. In the All Areas drop down, navigate to Settings > Security and click on Users.

Select all the required users to whom you want to provide the LinkedIn widget access and click on ‘Manage Roles’ at the top.

A dialog box will pop up as shown below and check ‘LinkedIn Configuration’ and click OK.

The user has finished importing and configuring the LinkedIn for Microsoft Dynamics CRM online solution.

Dynamics CRM Word Document Templates that use FetchXML for Complex Data Retrieval


It is a little bit longer but informative post so please bare with me :)

Dynamics CRM now allows you to create and persist Document Templates using Microsoft Word. I discovered one shortcoming. The user interface in CRM forces you to select a single starting entity and only entities that have a direct relationship for the data. SO what if you want to pull in data from other entities that do not have a direct relationship in your data model? Or what if you want to retrieve data from another external system?

We have already created reports in SSRS that use FetchXML as the data source so what else can we do to leverage FetchXML as the data source for the new Word Document Templates?. This approach is possible and not at all difficult leveraging the Open XML SDK for Microsoft Office.

1. Retrieve your Data

Determine what data it to be be retrieves to display in the Word Template.

The easiest way to create your FetchXML query is to do an advanced find from within CRM and then export the FetchXML from there.

So, for our example, let’s just run a default Fetch for Accounts.

Click the Download Fetch XML button and Save the resulting Fetch statement. You should have a simple FetchXML query that looks like the following:

Now that we know what data and how to get it, let’s move onto creating a Word Template.

2. Create Word Template in CRM

From the Settings menu select Templates and then Document Templates. 

From this page see the Available OOTB Templates that come with CRM and either Create a New Template or Upload one you already have.

For our approach, we will select New.

On the next screen, l select Word Template and for our example use the Account entity. Keep in mind that the entity you select is irrelevant with this approach since we will be retrieving and binding the data on our own.

After clicking Select Entity you are presented with the Select Entity screen  - pick any other Entities that have a direct Relationship to the Account. This is limiting since there might be other entities that we would like to pull in (or you might have data from other systems as well you would like to retrieve and display in the report).

At this point select Download Template and do some design in Word.

3. Populate Word Template with Content Controls

At this point we have a not-so-exciting blank document Open in Word. The first thing we need to do is Show the Developer tab in the Word Ribbon.


 Now we can insert Plain Text Content Controls to display the data we would like in the document.

 click the 2nd Aa button in the Controls section of the Developer tab.

See the Content Control appear in your document at the position of your cursor that reads "Click or tap here to enter text".

The Content Control is basically just a placeholder that you can use to control the layout of your document.

We still have not specified what data this field should display. - select the Content Control and click Properties from the Controls section of the Developer tab.

Now here is a bit of the magic, you must be familiar with what data you will be retrieving which we already determined in Section 1 when defining our Fetch.

You will need the following function to execute your Fetch and to return the results as a DataTable:

The call for that will look like the following:

This gives you a resulting XML in accountDataAsXML:

Let’s say for this first control we want to display the Account Name. The XPath for that in XML will be: /ReportData/Account/name.

XPath is straight forward you just follow down the hierarchy of the XML.
With that information, populate the tag on our Content Control so it looks like the following:


To keep this extremely simple since save the template and upload it into CRM. Just like before, from the Settings menu select Templates and then Document Templates. From this page, you can select UPLOAD TEMPLATE and browse out to the Word Template on your local system.



4. Retrieve Word Template Contents

 When you get ready to run the report (how you choose to do this is entirely up to you and can be custom workflow activity, plugin, etc.) you will need to retrieve the Word Template Contents. Here is a function to get the Document Template ID which is a basic retrieve of the DocumentTemplate entity with a name filter.

Once you have that, you can get the Document Template contents as a byte array like this:

5. Merge the data into the Word Document Template



So now at this point we have our CRM data in an XML string and our Word Document contents in a byte array and we need to get the two to merge. Here is an example of how to do that:

that’s a large amount of code, what does it all do? While most of this understandable to a CRM developer, the main part to pay attention to is the using statement with the WordprocessingDocument. To understand that code, take a quick detour into the land of OpenXML.

All Microsoft Office documents are just a bunch of files zipped together? Take that Word Document Template we have been working with on your machine for this example and change the .docx extension to a .zip. Now extract that file.? You might see something like this:

We won’t examine all of these files, look at the document.xml in the word folder. If you open that file then you will see an XML representation of what is in your Document starting with a ton of namespaces for the different Office libraries. After that you get into the body of the document which will look something like this:

Notice anything familiar? - that XPath that we entered on the Content Control is there in the tag  - right where we put it.

The Open XML SDK for Microsoft Office is what allows you to manipulate this underlying XML. So let’s do a quick breakdown of that code above.

To save the generated document as a Note on an entity, you could do something like the following (which again is fairly common CRM coding):

that was a whirlwind tour of how to leverage FetchXML for data retrieval and use that data within a Word Document Template.  To recap the steps are:

1.     Retrieve your data

2.     Create Word Template in CRM

3.     Populate Word Template with content control placeholders

4.     Retrieve the Word Template contents

5.     Merge the data into the template using the Open XML sdk.

 Keep in mind, that FetchXML is obviously only one choice for data retrieval and we chose that since we were porting over existing SSRS reports. You could also leverage other means of gathering data such as web services to external systems. The only real requirement is that the data you retrieve eventually ends up in an XML string so you can leverage XPath to bind it to the Content Controls.

IFraming Power BI Reports in Dynamics CRM


Power BI does not allow direct iframing of its components. If you want to iframe Power BI visuals then there are some options.

The “Power BI Embedded” service in Azure.  This service is intended for external sharing of your Power BI visuals and will cost you approx. Five cents every time someone looks at them. If your purpose is using Power BI in the context of Dynamics 365, then Power BI Embedded is not the answer.

The other option is to get a developer to create the Azure security tokens and authorizations required in your iframe to make it work. Documentation, with a video for that process is available here.

Take into consideration that Power BI is not specifically designed for reporting in context of customer profiles. On the other hand, that is exactly what Dynamics Customer Insights is designed to do, so look into this service prior to attempting to implement this feature with Power BI.

Dynamics Customer Insights, DCI, formerly known as Azure Customer Insights will be available with the next release of Dynamics 365. Disclaimer: The release was indicated during the keynote at eXtreme365, but to my knowledge not explicitly promised.

So, how can we create Power BI reports filtered to a specific account or another Dynamics 365 record and only one click away?

Create a URL with filter parameters for your report


The process is simple. Rather than having the Power BI report directly on the form in Dynamics 365, we will have a link that will open the filtered report in a new window.

I’m going to assume we already have a report in Power BI we want to use for this purpose.

Navigate to the report on http://www.powerbi.com and grab the unique URL for the report page.

You can filter this report by adding a few parameters to the end of the URL in this format.

?filter=Table/Column eq ‘guid’

For example

?filter=Account/accountid eq ‘329874328fsh9843298743298’

Note the quotes are single quotes and the table and column names are case sensitive and must match exactly what you have in Power BI. Spaces in the table and column names are prohibited so do not rename “accountid” to “Account Id”.

You can try out the URL you’ve constructed in the browser first to see if it filters the report as intended.

Create the URL in Dynamics 365


Now we have the unique URL for the report and the filter parameters we need.

In order to put the filtered URL on a form in Dynamics 365, we need a field that contains our URL and inserts the GUID of the record in it.

As Dynamics 365 does not let us use the GUID in a calculated field, nor in the processes, we will need a custom workflow process that gets the GUID and adds it to a custom field.

SeeWorkflow Elements by Aiden Kaskela for getting the record GUID.

First, create a field on the account called GUID. Make it a single text field.
Create a workflow to get the GUID of the record and insert the GUID in the new field.


      







On the update account step, use the first step of getting the metadata to insert the GUID.

Now, run the workflow on all your accounts, so make sure the workflow is available as On Demand.

we have a separate field with the GUID for all the accounts in Dynamics 365.
Back on the account entity, create a new single line of text calculated field for the URL.
Set the calculation to concatenate your unique report URL with the GUID field that you just populated


The URL text string is in yellow. The field with the GUID is in purple.

Note the inclusion of the single quote at the end of the formula.

This is the field that grabs the GUID and creates the filtered URL for the specific Power BI report.

Add the field to the form and publish your changes.

Try out the new link and the filtered Power BI report will pop out in a new window when you click on it.

Enabling for Views


However, if you add the link to a view the filtering does not work. This is due to the spaces, slashes and single quotes in the URL. If you use URL encoding for those characters instead, the link will also work from the views.

Replace the following:

  • space with %20
  • / with %252F
  • ‘ with %27

Here’s how it looks in the calculated field editor.
And now the links are functional in the views as well.

There’s an assumption that the users have access to the dataset and the report in Power BI that you are referencing, so make sure it is shared.

Note that this approach only works on reports and not dashboards. Dashboards in Power BI does not support filtering, although the individual tiles can be filtered prior to being pinned.

There are more details on URL filtering on the Power BI blog, including details on how you can use it to ensure a filter is preserved when you click on a dashboard tile and go to the report itself.

As I mentioned in the beginning, this approach is more of a workaround. If you want the tiles directly on the form itself, then you’d need to investigate the security token flow and get a developer to set it up. However, I’d encourage investigating Dynamics Customer Insights prior to going that route.

The workaround described here is something you can get up and running in 30 minutes or less assuming you already have the report you want to use.

Adding the standard Dynamics 365 charts to the form is also an option and could definitely be a viable solution, especially since less records are usually being queried when the charts are in the context of another record and only need to display related


Sunday, June 18, 2017

Estimated Revenue

Estimated Revenue is one of the most important fields on the Opportunity form in Microsoft Dynamics 365 for Sales. This field is used to help predict actual revenue and is the basis for the Sales Pipeline within an organization.
Many companies estimate the revenue of a project in different ways. People use factors like probability, budget, opportunity close date, and a number of combinations and calculations to project the revenue.
Aside from estimated revenue, companies want to know the weighted estimated revenue, which is often a combination of the estimated revenue based on the probability the revenue will be realized., Here is an easy and straightforward method for determining estimated weighted revenue.
As best practice creates the ‘Probability’ field as an option set dropdown with four options of 25%, 50%, 75%, and 90%. (  Maybe an extra one for 5% which is more of an unqualified suspect than an opportunity.)
This takes much of the guesswork out of determining probability. Because this number is largely subjective, by only having four options it keeps an organization consistent in its probability choices.
Using 90% for the fourth choice as opposed to 100% is done on purpose because if the probability were 100% then one would theoretically be closing the opportunity as won and not need to put in a probability.

There should be clear stage gate definitions to move to the next level. E.g. meeting with C-level, shortlisted, approved the budget in place, ROI justification etc.
Create a new field on your opportunity form for ‘Estimated Weighted Revenue’. This will be a simple currency field. In Dynamics, with the addition of Calculated and Rollup fields, there are many possibilities to do our calculations within the field itself.
In this example create a Business Rule to calculate estimated revenue from the probability. The important thing to note here is that you cannot calculate a currency or numeric value off an option set value. This is why we will use a business rule for our calculation.
Now that we have our new Probability dropdown and Estimated Weighted Revenue currency field on our form create a business rule to calculate that estimated weighted revenue. This calculation will be based on both Estimated Revenue and Probability % so you must have a value for estimated revenue already for the calculation to work.
Open a new business rule, give it a name, and add the first condition. For this condition, the first option in our Probability field is 25%.
                IF – Probability = 25%
Next add a Set Field Value Action:
                THEN – Estimated Weighted Revenue – (Choose Type = Formula)
                Field – Est. Revenue – (Choose Operator for multiply * ) – (Choose Type = Value) and Input .25
(See Below)
Next, continue to add conditions for if the probability option set equals 50%, 75%, and 90%. You can click Add and continue to add conditions and branches for however many probabilities you may have. You will do this, in the same way, the first IF THEN statement was created.
Then, Validate, Save, and Activate your Business Rule. Verify your Estimated Weighted Revenue is for example 75% of your Estimated Revenue if your Probability is 75%. Consider locking your weighted estimated revenue field now that this is defined by the business rule.
Measure the actual outcome against the tool  - sales often want to predict a lower target to make life easier, managers may want o maximizes the expected outcome of meeting C-level expectations
In practice there too many unknowns and a lot of luck, e.g people change mid-sale, there may be competitors you don’t know about, is there really a budget, who is the real decision maker, on what else could they better spend the money e.g. another salesman or a new factory – is there a compelling business reason to change? Or To go with you?  Generally, the deal is not won till someone gives you some money and success is usually lower than prediction and usually takes a lot longer. So the time bucket is also important.  Also useful to measure the actual against the predicted order date and to update the calculations accordingly. This si double edged- if you forecast next month then it may be 2 months later, but if you forecast 3 months away then the pressure to close comes off and a lot can change in 3 months – economy turns down, they lost a major account, a new competitor arrives, your key contact leaves, they shop around for lower quotes etc.
So it's important to have qualifications before progressing to the next stage- see the Infor sales guide on this.

Sunday, June 11, 2017

How to Configure and use the Portal Solution in Microsoft Dynamics 365

Installing/Configuring the Portal solution in Dynamics 365:

After successive registration of Microsoft Dynamics 365, don’t forget to configure the Portal Solution by navigating the Dynamics 365 in Office 365 Admin Centers.
Click Applications and select Portal Add-On, as its status is not configured it means you have to configure it out as per your organization requirements. So click the circled pencil icon to manage the portal solution.
 Click Portal Details to add the following inside information:
1.     Name: Put a suitable name for your organization’s portal.
2.     Type: Select the type of your instance is Live or Dev (Production or Sandbox) respectively.
3.     Base Portal URL: Set the URL to access the portal.
4.     Portal Audience: Select the consultations whether it will be Customers or Employees.
5.     Select Website Record: There are 3 types of portals available out of the box (as shown in the below image), select 1 to get started. You can swap it in future but remember you can only use one at a time.
6.     Portal State: Turn it On when you want it to get visible for the audience, otherwise make it Off.
7.     Update: After putting all the info press this button OR every time you make changes click update, in the end, you will find a message saying the update has been done successfully on the top of this form.
By Clicking Portal Actions you can perform various activities:
1.     Add a custom Domain Name: By adding SSL Certificate, you can upload a new SSL certificate but it must be a Personal Information Exchange (.pfx) certificate file that is less than 2 MB in size.
2.      Make sure it is not expired and that it is SHA2 encrypted because SHA1 encrypted certs have been deprecated - or also use the existing one. P
3.     provide a Hostname, then binds it and do confirmation. By following these steps you can able to add a custom domain name to your portal.
4.     Restart: You can restart/refresh your portal.
5.     Update Dynamics 365 URL: Whenever you change or modify your portal URL you can update it from here.
6.     Install Project Service: You can directly install Project Service Extension from here.
7.     Install Field Service: You can directly install Field Service extension from here.
8.     Get Public Key: The Microsoft Dynamics 365 platform applies an additional security restriction to registered offline plug-in assemblies.
9.     When Microsoft Dynamics 365 for Microsoft Office Outlook with Offline Access is installed, an AllowList key is added to the system registry on the client computer.
For each assembly containing an offline plug-in that you register, you must add a registry sub-key under the AllowList key with the key name derived from the assembly’s public key token. Failure to add this key results in the offline plug-in not being executed by the platform even though the plug-in is registered. This walkthrough describes how to add this sub-key for a plug-in assembly. {Reference}


Configuring Web Roles in Microsoft Dynamics 365:

As at least a user account of yours has to be to configures in the Portal with having the administrative rights in order to edit, add/remove the items, entities, titles, polls, check out boxes, and other things you need to apply on to your Portal.

Navigate to the Dynamics 365 portals -> Web roles -> you should be able to find the web roles there and you can also able to create new web roles to dedicate it, to the Super Admin User/Contact in order to apply changes on to the portal.

Using Super Admin Rights on Portal Interface:
By going to the URL that you have set earlier in the portal configuration, you can able to open the portal website and get in by signing in. If you have Admin role then you can do the following:
1.     By redeeming the code get to log in as Administrator.
2.     Link your CRM Entity Forms with your Portal.
3.     Edit, Add/Remove Navigational items.
4.     Create child Pages.

More Than One Form Was Opened at Once for the Lookup Control

In Dynamics 365 for Finance and Operations, when subscribing to a lookup event to modify an existing lookup on a form control, you must...