Advertisements

Archive

Archive for the ‘Uncategorized’ Category

(Step By Step) Surface Power BI Reports in Dynamics CRM Dashboard

In this article, I am going to provide ‘Step-by-Step’ details on how to:

  • Add ‘Power BI’ subscription to your existing Office 365
  • Connect to your ‘Dynamics CRM Organization’ from BI
  • Render Power BI reports in CRM Dashboard.

What’s Power BI and How is it different from SSRS?

  • Power BI offers basic data wrangling capabilities like Excel’s Power Query.
  • It also lets you create interactive visualizations, reports and dashboards with a few clicks and handle files that are too large for Excel.
  • On the other hand, SSRS is meant for “static” reports. Something that will be shown always as defined and printable.

Steps to add ‘Power BI’ subscription:

  • As a pre-requisite, create your 30 days Dynamics 365 free trail.
  • Login to ‘Portal.office.com’ and open ‘Admin’ dashboard
  • Go to ‘Billing -> Purchase services -> Power BI (free) -> Buy now
    • Note: This requires you to provide credit card details and INR 2 will be charged after successful purchase.

D365 - Power BI

  • After successful purchase, open ‘PowerBI.com’ on another tab of the browser and click ‘Sign In’

D365 - Power BI - Start

  • Click ‘Start’

Connect to Dynamics CRM organization from Power BI:

  • To connect to CRM Organization from ‘Power BI’, you need to install one of the ‘Content Packs’

D365 - Power BI - Content Packs

  • Click on ‘Get’ button from ‘My organization’ section
  • From the available list, choose any of the Dynamics CRM related Apps (I chosen ‘MS Dynamics Online Sales Manager’ for this demo, from the ‘Apps’ tab)

D365 - Power BI - CRM Sales Manager Pack

 

  • Click on ‘Get it now’ and you will be asked to provide CRM credentials.
    • Provide ‘CRM Organization URL’ details and ‘Last Month Of the Fiscal’

D365 - Power BI - Connect To CRM

    • Choose ‘Authentication Method’ as ‘OAuth2’

D365 - Power BI - Connect To CRM - OAuth

  • Post successful login, you would see ‘Importing Data’ message

D365 - Power BI - Connected To CRM - Importing Data

  • Give it few seconds and you would see beautifully rendered reports

D365 - Power BI - Connected To CRM - Dashboards.PNG

Display ‘Power BI’ reports in CRM Dashboard:

In previous versions of CRM, only option to bring ‘Power BI’ reports are by placing an IFrame in Dashboard and set the PowerBI URL. Its easily configurable now.

  • Connect to your Dynamics CRM Organization
  • Go to ‘Settings -> Administration -> System Settings -> Reporting -> ‘Allow Power BI….’=Yes

D365 - Enable embed Power BI

  • Create a new Dashboard
  • Select the placeholder and from the Report add options, click ‘Power BI Tile’

D365 - New Dashboard - Add Power BI Tile

  • Pick one of the available ‘Power BI Reports’

D365 - Add Power BI Tile - Pick Dashboard

  • Save the Dashboard
  • Go to ‘Sales -> Dashboard’ and pick the created ‘Dashboard’

D365 - Open Dashboard in D365

🙂

Advertisements

Dynamics 365 – Error while sending mail on behalf of another user

Recently one of my users complained that they could not send mails on behalf of another users.

Unable to send email on behalf of another user

Issue was because of missing privilege and a setting at actual user, whom the other user trying to send on behalf of

Reason and fix:

To explain this better, I have 2 Users in my system

  • ‘Aruna’ : Having ‘Salesperson’ security role
  • ‘Rajeev’: Having ‘System Administrator’ security role

Issue coming up when ‘Aruna’ trying to send email as ‘Rajeev’ (i.e., Email.From=’Rajeev’)

To allow ‘Aruna’ send email as ‘Rajeev’ below 2 conditions has to be met

  • Provide ‘Send Email as Another User’ privilege to Aruna’s ‘Salesperson’ Security Role

Security Role - Send email as another user

  • Actual User (i.e., Rajeev) should enable ‘Select whether users can send email for you‘ option in his Personal Settings.

Personal Options - Other users can send email

🙂

ADX Web Site Compilation Error – The type ‘System.Object’ is defined in an assembly that is not referenced.

Recently while compiling my ADX web site, I was getting below compilation exception from all my .ascx (Views) files.

Compiler Error Message: CS0012: The type ‘System.Object’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’

Issue was bit strange as I already had “System.Runtime’ dll referred in the website

Fix:

  • Open the Web.config file and add below tag inside the <compilation> tag

<assemblies>

<add assembly=”System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a” />

</assemblies>

  • Your <compilation> tag should look as below

<compilation debug=”true” targetFramework=”4.5″>

<assemblies>

<add assembly=”System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a” />

</assemblies>

</compilation>

Note:

  • If your <compilation> tag already had <add assembly=”…”> tags, add only <add assembly=”System.Runtime…> tag to the existing tags.

🙂

Categories: ADX, CRM, Uncategorized Tags: ,

Solution Import Failures / Publish Customizations Failures – Dynamics 365

February 12, 2017 Leave a comment

Recently we upgraded our organizations to Dynamics 365 and we were getting solution import failure while moving solutions between organizations.

Below are different kind of error messages popped up.

  • Getting Dependency Calculation There was an error calculating dependencies for this component. Missing component id {0}
  • Failure trying to associate it with CustomControlDefaultConfig
  • Can’t insert duplicate key for an entity

Reason:

  • In our case the root cause for all these import failures was “customcontroldefaultconfig” component with Custom entities.
  • If there is any orphan record exists in “CustomControlDefaultConfigBase” table it would cause solution import failure or ‘Publish Customizations’ error.
  • The issue seems a product issue and got fixed in Service Update 5 of CRM 8.1.0 but resurfacing again in Dynamics 365.

Prevention Tip:

  • If you are adding an entity to your solution, always add ‘Primary key’ field
    • In the source environment open the Solution being imported
    • Open each Entity and expand Fields
  • Make sure that every entity has its “Primary Key” added to the solution.

solution-add-primary-key-field-of-entity

Fix:

CRM On-Premise

  • Check if any orphan records in CustomControlDefaultConfigBase tabel. (Use below queries)
    • SELECT * FROM CustomControlDefaultConfigBase WHERE PrimaryEntityTypeCode NOT IN (SELECT ObjectTypeCode FROM Entity)
  • Note: before continuing, a backup database is recommended.
  • Delete from the Target environment the CustomControlDefaultConfig records with orphaned Object Type Codes:
    • DELETE FROM CustomControlDefaultConfigBase WHERE PrimaryEntityTypeCode NOT IN (SELECT ObjectTypeCode FROM Entity)

CRM On-line

  • Create console application to delete the orphan record in CustomControlDefaultConfigBase using CRM SDK
  • Refer this URL for code.

🙂

CRM Record “Email a Link” feature not working

February 8, 2017 Leave a comment

Recently few of our CRM users complained OOB “Email a Link” not working.

email-link

Reason:

  • Machines default “Email” App was set to “Chrome”

email-settings

Fix:

  • Change default “Email” App to “Mail” or “Outlook” client

 

email-settings-set-to-mail-client

🙂

Categories: CRM, Uncategorized Tags: , ,

Retrieve Global Option set details – CRM SDK

January 28, 2017 Leave a comment

Below is the sample code to retrieve existing Global Option sets along with Option text & values using RetrieveAllOptionSetsRequest :

var retrieveAllOptionSetsRequest = new RetrieveAllOptionSetsRequest();

RetrieveAllOptionSetsResponse retrieveAllOptionSetsResponse = (RetrieveAllOptionSetsResponse)orgService.Execute(retrieveAllOptionSetsRequest);

if (retrieveAllOptionSetsResponse.OptionSetMetadata.Count() > 0){
StringBuilder sb = new StringBuilder();
foreach (OptionSetMetadataBase optionSetMetadataBase in retrieveAllOptionSetsResponse.OptionSetMetadata){
if (optionSetMetadataBase.OptionSetType != null){
if ((OptionSetType)optionSetMetadataBase.OptionSetType == OptionSetType.Picklist){
OptionSetMetadata optionSetMetadata = (OptionSetMetadata)optionSetMetadataBase;
sb.AppendLine(“OptionSetDisplayName – ” + ((optionSetMetadata.DisplayName.LocalizedLabels.Count > 0) ? optionSetMetadata.DisplayName.LocalizedLabels[0].Label : String.Empty));
sb.AppendLine(“***************************************************”);

foreach (OptionMetadata option in optionSetMetadata.Options){
sb.AppendLine(“Option”);
sb.AppendLine(“OptionValue – ” + option.Value.ToString());
sb.AppendLine(“OptionDescription – ” + option.Label.UserLocalizedLabel.Label.ToString());
}
}
else if ((OptionSetType)optionSetMetadataBase.OptionSetType == OptionSetType.Boolean){
BooleanOptionSetMetadata optionSetMetadata = (BooleanOptionSetMetadata)optionSetMetadataBase;
// Start OptionSet Node
//metadataWriter.WriteAttributeString(“OptionSetType”, OptionSetType.Boolean.ToString());
if (optionSetMetadata.DisplayName.LocalizedLabels.Count != 0)
sb.AppendLine(“OptionSetDisplayName – ” + optionSetMetadata.DisplayName.LocalizedLabels[0].Label);
else
sb.AppendLine(“OptionSetDisplayName – ” + “UNDEFINED”);

sb.AppendLine(“**************************************************”);

// Writes the TrueOption
sb.AppendLine(“TrueOption”);
sb.AppendLine(“OptionValue – ” + optionSetMetadata.TrueOption.Value.ToString());
sb.AppendLine(“OptionDescription – ” + optionSetMetadata.TrueOption.Label.UserLocalizedLabel.Label.ToString());
sb.AppendLine(“FalseOption”);
sb.AppendLine(“OptionValue – ” + optionSetMetadata.FalseOption.Value.ToString());
sb.AppendLine(“OptionDescription – ” + optionSetMetadata.FalseOption.Label.UserLocalizedLabel.Label.ToString());
}
}
sb.AppendLine(string.Empty);
}

Console.WriteLine(sb.ToString());

Output would be

global-options-1

global-options-2

🙂

Categories: CRM, Uncategorized Tags: ,

New field ‘Sort Date’ in Activity Pointer entity – Dynamics 365

January 26, 2017 Leave a comment

A new field ‘Sort Date’ (Schema Name – sortdate) has been added to the ‘Activity Pointer’ entity to control the sorting of the Activities.

sort-date-activities

Limitation with earlier CRM versions:

  • To display a list of activities and order them by date, we can only use the common date attributes like ‘Created on’ or ‘Modified on’ defined in the activitypointer entity.
  • What if you have to sort Email activities by ‘Sent On’ attribute rather than the modifiedon attribute value?

How ‘Sort Date’ Solves This:

  • With ‘Sort Date’ attribute, we can control how activities are sorted by desired date.
  • By default, the ‘Sort Date’ attribute value is null.
  • Set the ‘Sort date’ attribute value using a workflow or a plugin with required Date value (For example, set ‘Sort Date’ with ‘Sent On’ value in case of Emails) and use that in views.

🙂