Advertisements

Archive

Posts Tagged ‘Dynamics 365’

What’s new for Developers/Admins/End Users – Dynamics 365 – v 9.0

With July 2017 update (v 9.0) there is a great set of new features introduced.

Now onward, the apps that make up the customer relationship management (CRM) portion of Dynamics 365 are referred to as “Customer Engagement” and include Sales, Customer Service, Field Service, Project Service Automation, and their related services.

In this article I am going to touch base few new features at a high level. I will be covering each feature in detailed in follow up articles.

UX Enhancements:

  • Removal of unneeded white space on forms and dashboards.
  • On forms, long text labels and values are wrapped. Admins can control word wrap through system level settings.

Text wrapping

  • The color of a sub-grid header can be customized at the form level
    • While adding sub grid to a form, now we have an option to set ‘Panel Header Color’

Sub grid Header Color

  • Themes – There are now three new standard themes to choose from.

Themes

  • Email editor control has been updated with rich editing capability.
  • Enhancements to ‘Sitemap Designer’ and ‘View Designer’

Advanced Find:

  • Advanced Find has got ‘Not In’ query option using “Does not contain data” operator.
  • Refer my previous article

Advanced Find - Not IN

Activity management:

  • New Quick Create forms have been introduced for Task, Phone Call, and Appointment with customization capabilities.

Dynamics 365 mobile app:

  • The new mobile app is built on the new Unified Interface, which provides key accessibility and responsive design benefits.
  • If you can add iFrames and web resources in forms and dashboards in a Dynamics 365 (online) web app, they will be enabled in Dynamics 365 for phones as well, if you check the box to enable iFrames and web resources for phones.

Virtual Entities:

  • A virtual entity is a custom entity in Dynamics 365 (online) that retrieves data at runtime from an external data source.
  • Records based on virtual entities are available from all Dynamics 365 (online) clients, including custom applications developed using the Dynamics 365 SDK.
  • Several options, such as Access Teams, Queues, and Quick Create, aren’t available with virtual entities.
  • Virtual entities are organization owned.
  • All virtual entities are read-only.
  • Existing entities cannot be converted to virtual entities.
  • Virtual entities don’t support auditing.
  • Virtual entity fields can’t be used in rollups or calculated fields.

MultiSelect option set:

D365 - Multiple Optionset - on form

Web resource dependencies:

  • In this release, you can now specify web resources during customization that will be used at run-time to include dependencies. This makes it easier to ensure that HTML, JavaScript resources, and all dependent resources are loaded appropriately.

Web resource localization:

  • This release includes support for a new resource type, RESX, which is an XML-based file format that supports comments associated with key+value translation pairs and is supported in Visual Studio.
  • You can associate RESX web resources with any JavaScript web resource that uses them so that you can use a new client-side API to access localized strings at run time.

Vector Image web resources:

  • Use vector images for any icon presented in the application.
  • The advantage of vector images over other image web resources is that they scale.
  • You can define one vector image and re-use it rather than provide multiple sizes of images.
  • You can use this web resource to define a single icon for an entity rather different sized images.

Web API improvements:

  • GrantAccess, ModifyAccess, and RetrieveSharedPrincipalsAndAccess messages are now available using the Web API.

Client API Enhancements:

  • Xrm.Page.context is deprecated in this release and will be replaced by Xrm.Utility.getGlobalContext
  • Xrm.Page.data.save(saveOptions) method’s ‘saveOptions’ to include a new value called SaveMode to let the onSave event handlers know why the save is happening.

Grid Click event – Override the default open behavior of data rows in an entity-bound grid:

  • As an OOB grid behavior, on double click of data row or clicking hyper link in Data row will open the entity record.
  • With this release, we can now override the default behavior to define your own custom behavior.
  • Create a command definition for an entity with Mscrm.OpenRecordItem as the value of the Id attribute (<CommandDefinition> (RibbonDiffXml)), and define custom action for the command <Actions> (RibbonDiffXml)
  • System will look for this command Id for an entity when you try to open a record from the entity-bound grid, and if present, will execute the custom action instead of opening the entity record (default behavior).

Customer Service Hub:

  • The Customer Service Hub (called Interactive Service Hub in earlier releases) has been rebuilt on the new Unified Interface as a stand-alone application.

Business process flows enhancements:

  • Business Process flow is now an entity and you can create custom views.
  • Business Process entities can now be made available on the site map

Useful articles:

🙂

Advertisements
Categories: Dynamics 365 Tags: ,

Query using ‘Not In’ filter – Advanced Find – Dynamics 365 – V 9.0

October 7, 2017 1 comment

In the previous versions of CRM, there is no option in Advanced Find, to query all ‘Case’ records that do not have a related task, as we don’t have option to execute ‘Outer Join’ (i.e., Not in).

In V9.0 release, a new ‘Does not contain data‘ option added to ‘Advanced Find’ to filter ‘Not In’ records.

Let’s get started to fetch all the ‘Accounts’ which does not have any associated ‘Contacts’

  • Open ‘Advanced Find’
  • Select ‘Account’ entity and from the Related entities choose OOB ‘Contacts(Company Name)’ relationship.
  • Choose ‘Does Not Contain Data’ from filter option.

Advanced Find - Not IN

  • Fetch XML will be as below

Fetch XML - Not IN

🙂

(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

🙂

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.

🙂

Dynamics 365 Mobile Client – Script to get Longitude and Latitude and pin to Maps

January 14, 2017 2 comments

With the new Dynamics 365 Mobile client, we got a new API Xrm.Utility.getCurrentPosition which returns the current location coordinates.

This API only works with Mobile Client and referring this in Web Application would cause script error.

Pre-requisite:

We need to Enable User Location setting on the device

  • Go to Settings -> Device Integration Settings
Device-integration-settings

Device-integration-settings

  • Enable “User Content and Location”
Enable-user-location

Enable-user-location

Script to get coordinates:

function onload() {
var isCrmForMobile = (Xrm.Page.context.client.getClient() == “Mobile”);

if (isCrmForMobile) {
Xrm.Utility.getCurrentPosition().then
(function (location) {
Xrm.Utility.alertDialog(“Latitude: ” + location.coords.latitude +
“, Longitude: ” + location.coords.longitude);
},
function (error) {
Xrm.Utility.alertDialog(error.message);
})
}
}

Get-longitude-and-latitude

Get-longitude-and-latitude

HTML File to Read Coordinates and Show in Map

html-show-location-on-map

🙂

Code snippet – Connect to Dynamics CRM using Organization Service C#

December 11, 2016 1 comment

Below is the sample code to connect to Dynamics 365/CRM online 2016 using simplified connection.

This sample authenticates the user with the Dynamics 365 web services by using the CrmServiceClient and methods.

Required CRM SDK .Dlls:

  • Download the SDK to get the required .dlls
Required dlls

Required dlls

Required Namespaces :

using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Client;
using Microsoft.Xrm.Tooling.Connector;

Configure connection string in App.Config:

O365 Connection strings

O365 Connection strings

C# Code:

try{
String connectionString = GetServiceConfiguration();
CrmServiceClient conn = new CrmServiceClient(connectionString);

// Uncomment below statement in case you want to use Organization Service
// IOrganizationService orgService = conn.OrganizationWebProxyClient != null ? conn.OrganizationWebProxyClient : (IOrganizationService)conn.OrganizationServiceProxy;

OrganizationServiceProxy orgService = conn.OrganizationServiceProxy;

// To impersonate, set the caller GUID
orgService.CallerId = new Guid(“D0DED6CA-5A65-E611-80DD-FC15B42877A8”);

// Create Account

Entity account = new Entity(“account”);
account[“name”] = “Peter Parker”;
Guid accountId = orgService.Create(account);

// Who Am I Request

// Guid userid = ((WhoAmIResponse)orgService.Execute(new WhoAmIRequest())).UserId;

Console.ReadLine();
}
catch (Exception ex){
Console.WriteLine(“Exception : ” + ex.Message);
Console.ReadLine();
}

// To Read Connection Strings From <App.Config>

private String GetServiceConfiguration(){
// Get available connection strings from app.config.
int count = ConfigurationManager.ConnectionStrings.Count;

// Create a filter list of connection strings so that we have a list of valid
// connection strings for Microsoft Dynamics CRM only.
List<KeyValuePair<String, String>> filteredConnectionStrings =
new List<KeyValuePair<String, String>>();

for (int a = 0; a < count; a++)
{
if (isValidConnectionString(ConfigurationManager.ConnectionStrings[a].ConnectionString))
filteredConnectionStrings.Add
(new KeyValuePair<string, string>
(ConfigurationManager.ConnectionStrings[a].Name,
ConfigurationManager.ConnectionStrings[a].ConnectionString));
}

// If one valid connection string is found, use that.
if (filteredConnectionStrings.Count == 1)
{
return filteredConnectionStrings[0].Value;
}

return null;
}

private Boolean isValidConnectionString(String connectionString){
// At a minimum, a connection string must contain one of these arguments.
if (connectionString.Contains(“Url=”) ||
connectionString.Contains(“Server=”) ||
connectionString.Contains(“ServiceUri=”))
return true;

return false;
}

Refer MSDN article for more details.

🙂

Dynamics 365 – PowerApps

November 20, 2016 Leave a comment

PowerApps is a service for building and using custom business apps that connect to your data and work across the web and mobile.

PowerApps enables power users in line of business roles to easily build and deploy business apps – without the time and expense of custom software development.

In this article, I am going to create a simple PowerApp which allows me to work with my Case records.

Step by step creating App:

  • Subscribe for 30 days trail of Office 365
  • After sign up, on the Home page, select “PowerApps”
Power-app-office-365

Power-app-office-365

  • It will take to ‘PowerApps’ home screen.
  • To create new App, click on “New app” and from the popup,
    • If you have machine running on Windows 8 or Windows 10, Choose “PowerApps Studio for Windows” which will take you to Store to download the App
    • Choose “PowerApps Studio for Web” to design in browser.
Create-new-app

Create-new-app

  • I chose “PowerApps Studio for Windows” and downloaded the “PowerApps” from Windows Store
Microsoft-store

Microsoft-store

  • After download, launch the “PowerApps” studio.
  • As we are creating App to work with CRM Cases, choose “Dynamics 365” as your Data Source
Connect to Dynamics 365

Connect to Dynamics 365

  • Choose the ‘Dataset’ as your Organization (Its “MS” for me)
  • Choose the ‘Table’ as “Cases” entity and click on “Connect”
Connect to Organization Data Set and Cases Table

Connect to Organization Data Set and Cases Table

  • Studio opens up the designer with default screens (i.e.,Browse, Details, Edit) for Case’s  records.
Layout screens

Layout screens

  • You can add/remove fields or icons on the screens or create a new screen.
  • Once the design completes, click “ File -> Save” to save the App
Save the App

Save the App

  • I saved the App as “My First App”

Run the App:

  • Go to PowerApps home screen and select the App to run.
My App

My First App

  • Click the App and it will run and pull the Cases from my Dynamics 365 organization.
My first app running

My first app running

Share the Power App:

  • Also, App can be shared across the Organization or to specific Users.
  • Select the App and click on ‘Share’ option
Share-the-app

Share-the-app

🙂

Categories: Dynamics 365 Tags: ,