Advertisements

(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

🙂

Dynamics 365 – Native Sitemap Editor

Before Dynamics 365, to edit the Sitemap we had to rely on 3rd party solution like ‘XRM Tool Box’ Site Map Editor, Visual Sitemap Editor.

With advent of Dynamics 365, a native ‘Sitemap Designer’ has been shipped with product and its very simple to use.

To edit the sitemap

  • Open ‘Default Solution -> Client Extensions’
  • You would get all the available Sitemaps listed (If you subscribed to Field Service, Project Service etc, you would see additional sitemaps)
  • For this article, I am going to edit the default ‘Site Map’, so double click on ‘Site Map’
  • It would open ‘Sitemap Designer’
  • To rearrange the ‘Sub Areas’ (i.e., Entity/Component icons) you just need to drag and drop

D365 - Sitemap Editor

Add new Sub Area to Sitemap:

Let me add an Icon (i.e., Sub Area) to open ‘Dashboards’ with default as the ‘Customer Service Operation Dashboard’ under ‘Customers’ group

  • Select the ‘Customers’ group and from the ‘Components’ tab, drag and drop ‘Sub Area’
  • Set the ‘Type’ as ‘Dashboard’, ‘Default Dashboard’ as ‘Customer Service Operation Dashboard’ and Title

Sitemap Editor - Add Dashboard

  • Save and Publish.

Hide/Show Sub Area using ‘Privileges’:

Sometimes we get a requirement to show/hide Sitemap icons based on User’s Security Role.

  • Select the Sub Area
  • Expand the ‘Advanced -> Privileges -> Entity’
  • Choose the entity (i.e., I set the Entity as ‘Site map permission’ which is a custom entity)

Sitemap Editor - Sub Area Privileges

  • Only users having ‘Security Role’ with Read privilege on the ‘Site map permission’ entity can see the icon

We can also set localization labels, Clients (i.e., Web or Outlook or Mobile) where the Sub Area should be available to.

🙂

Categories: CRM, Dynamics 365 Tags:

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: ,

Wait Condition with ‘Parallel Wait Branch’

February 19, 2017 Leave a comment

In my previous article , I explained using ‘Wait Condition’ with simple scenario. In this article, lets see using ‘Parallel Wait Branch’ with Wait Conditions.

Lets take a simple scenario

  • Up on Opportunity creation, if an Account associated with Opportunity ‘Send Mail’ to Opportunity owner OR close the Opportunity as Lost, if no association happen with in 7 days.

To achieve the above scenario, we have to go with ‘Parallel Wait Branch’ with 2 Wait Conditions

Configuring Work Flow :

  • Create a workflow on Opportunity which triggers when ‘Record is created’
  • Add a “Wait Condition” to check, if Account got assigned to Opportunity (I.e., Opportunity. Account ‘Contains Data’)
  • Create an Email Activity, if ‘Wait Condition’ met
  • Select that wait condition and then choose the ‘Parallel Wait Branch’ option from the Add Step menu
  • Add another “Wait Condition” with ‘Time Out’ option for 7 days

Wait Condition - Time Out.PNG

  • If condition met, add ‘Change Status’ step to close the Opportunity as Lost and Canceled.
  • Workflow looks as below

parallel-wait-condition

  • Save and Activate Workflow

Points to consider using Wait condition:

  • While using a Timeout, and if the date changes, the timeout will automatically adjust and wait until the new date.
  • Even if that date is changed to be in the past, the timeout will readjust to the new date, and will fire instantly.
  • If the server goes down, or the async service stops, any workflows that are ‘waiting’ will be resumed when the server/async service comes back up.
  • If the server/async is down at the exact time as when a wait condition is waiting until, the workflow will continue again when the server/async comes back up, and it will process the wait conditions that were due during the down time.

🙂

Categories: CRM Tags: ,

‘Wait Condition’ in Workflow Explained

February 19, 2017 1 comment

I was asked by one of my blog followers to explain ‘Wait Condition’ in Workflow.

wait-condition

To explain this better, I took a small scenario

  • Send an Email to Opportunity Owner, whenever an Account has been assigned to the Opportunity

Configuring Work Flow :

  • Create a workflow on Opportunity which triggers when ‘Record is created’
  • Add a “Wait Condition” to check, if Account got assigned to Opportunity (I.e., Opportunity. Account ‘Contains Data’)

workflow-wait-condition

  • Create an Email Activity, if ‘Wait Condition’ met

workflow-send-email-when-wait-condition-met

  • Save and Activate Workflow

Test the Workflow

  • Create new Opportunity

new-opportunity

  • Check the Waiting job in ‘System Jobs’
    • Since we have the Wait condition set in our workflow, the Job will wait until the condition met

waiting-job

  • Associate ‘Account’ to the ‘Opportunity’

opportunity-associated-account

  • Check the Waiting Job now and it should have completed.

waiting-job-completed

  • New Email created in system as the follow up action

Key Points to consider before using Wait Conditions:

While the ‘Wait conditions’ are useful in case of the timer related tasks which will be achieved with no coding, excessive use of wait conditions has a downside.

  • Performance:
    • Each waiting workflow instance carries performance overhead. The more waiting workflow you have, the more server resources will be consumed by the Asynchronous Processing Service.
    • If you change the logic in your workflow and republish (like update the text of the email sent to your client), it does not change waiting workflow instances. For example, if you change the renewal email frequency to 15 days rather than 30 days, any workflow instances that are waiting will not be updated.

🙂

 

Categories: CRM 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.

🙂