Archive

Posts Tagged ‘CRM 2015’

Incorrect date (KPI) calculation – Enhanced SLA

September 28, 2015 Leave a comment

We have an ‘Enhanced SLA’ configured in our CRM application which was working fine in development environment.

Recently we deployed solution on Customer’s server and surprisingly SLA showing incorrect First Response\Resolve by KPI’s hence ‘SLA Counter’ showing wrong timer.

Refer below screen where Timer showing 561 days however ‘Failure Date’ was after 3 days.
Incorrect SLA Counter

Incorrect SLA Counter

Reason

  • Looks like its product issue with date calculations for non US based servers.
  • In simple terms if your CRM Application Server’s Region is Non-Us you might get wrong date calculations.
  • My customer is non-Us based and all the servers ‘Region’ settings set to their country which causing the issue.

Fix

  • In my case changing CRM Site Globalization culture to English (United States) (en-US) solved the issue.
  • Follow below steps
    • Open IIS
    • Select ‘Microsoft Dynamics CRM’ website
    • Double click on ‘.NET Globalization’ feature
    • Set ‘Culture’ and ‘UI Culture’ to ‘English (United States) (en-US)
CRM Website- Net Globalization

CRM Website – Net Globalization

  • Reset the IIS

Refer this article for more details

🙂

Why my Enhanced SLA not triggering – CRM 2015

August 29, 2015 1 comment

I was exploring ‘Enhanced SLA’ feature in CRM 2015. I created my first basic enhanced SLA with below steps

  • Created a new SLA
Enhanced SLA

Enhanced SLA

  • Added a new ‘SLA Item’ with no ‘Applicable When’ criteria (i.e., SLA should kick in for all Case’s if no criteria given) and ‘Success Criteria’ as Case Status ‘Resolved’
Applicable And Success Criteria

Applicable And Success Criteria

  • Set the Failure Duration as ‘5 minutes’ and Warn Duration as ‘1 Minute’
Duration

Duration

  • Activated the SLA
Enhanced SLA - Activation

Enhanced SLA – Activation

  • Created a new Case.
  • But no Timer or ‘SLA KPI’ records logged when I expanded ‘Enhanced SLA Details’ section.
Enhanced SLA Details

Enhanced SLA Details

Reason

  • There was no ‘Entitlement’ configured
  • So what is an Entitlement?  ‘Entitlements’ are correlated to Customers (i.e., Either Account or Contact) in the system and define what kind of support your customers are eligible for.
Entitlements

Enhanced SLA – Entitlements

Note : If you don’t want to configure ‘Entitlement’ make to set SLA as Default which will be applicable for all Customers.

Fix

  • Since I am just exploring SLA’s, I did not create an ‘Entitlement’ instead I made my SLA as ‘Default’
Enhanced SLA - Set Default

Enhanced SLA – Set Default

  • Created a new Case and this time got the OOB Timer and SLA KPI record in sub-grid.
Enhanced SLA - Triggered

Enhanced SLA – Triggered

Additional Details

  • How to Pause a SLA
    • Using ‘Enhanced SLA’ you can put SLA on ‘HOLD’ by choosing Case ‘Status’ with pre-configured ‘Case Status’ (Refer screen how to configure Status)
    Enhanced SLA - Set 'HOLD' status

    Enhanced SLA – Set ‘HOLD’ status

    • Go to the ‘Case’ and choose Status = ‘On hold’ and Save
    Case - Choose 'On Hold' status

    Case – Choose ‘On Hold’ status

    • See the Resolve in set to ‘Paused’
Enhanced SLA - Case 'On Hold'

Enhanced SLA – Case ‘On Hold’

🙂

‘Xrm’ does not exist in namespace ‘Microsoft’ – Build error while referring CRM 2015 SDK Dll’s

I got below annoying build error while adding early binding class to my Plug-in Project and build.

XRM does not exist in namespace

XRM does not exist in namespace

It was bit strange as I already referred ‘Microsoft.XRM.SDK.dll’ from CRM 2015 SDK.

Reason :

  • CRM 2015 SDK has built on .Net 4.5.2 Framework and my Visual studio does not support 4.5.2

Fix:

Application Target Framework

Application Target Framework

🙂

Connecting to CRM from other applications using CrmConnection class – CRM 2015

Assume that you have an ASP.Net web application and you want to retrieve Contacts from CRM and display in a grid.

Before CRM 2015, to establish a connection with CRM we need to create a service proxy with user credentials (Refer article).

With CRM 2015, we can use “Connection Strings” to connect to the CRM server from external application.

You define the CRM connection strings in <web.config> or <app.config> as below

<configuration>

<connectionStrings>

    <!– Online using Office 365 –>

<!– <add name=”Server=CRM Online, organization=contoso, user=someone” connectionString=”Url=https://contoso.crm.dynamics.com; Username=someone@contoso.onmicrosoft.com; Password=password;”/> –>

    <!– Online using Microsoft account (formerly Windows Live ID) –>

<!– <add name=”Server=CRM Online, organization=contoso, user=someone@example.com” connectionString=”Url=https://contoso.crm.dynamics.com; Username=someone@example.com; Password=password; DeviceID= DevicePassword= “/>–>

    <!– On-premises with provided user credentials –>

<!– <add name=”Server=myserver, organization=AdventureWorksCycle, user=administrator” connectionString=”Url=http://myserver/AdventureWorksCycle; Domain=mydomain; Username=administrator; Password=password;”/> –>

    <!– On-premises using Windows integrated security –>

<!–<add name=”Server=myserver, organization=AdventureWorksCycle” connectionString=”Url=http://myserver/AdventureWorksCycle;”/>–>

    <!– On-premises (IFD) with claims –>

<!–<add name=”Server=litware.com, organization=contoso, user=someone@litware.com” connectionString=”Url=https://contoso.litware.com; Username=someone@litware.com; Password=password;”/>–>

</connectionStrings>

</configuration>

And you can establish connection in your code as below

// ‘CRMOnline’ is ConnectionString name defined in <web.config> or <app.config>

var connection = new CrmConnection(“CRMOnline”);

var service = new OrganizationService(connection);

var context = new CrmOrganizationServiceContext(connection);

Refer MSDN article for more details

🙂

Categories: CRM 2015 Tags: ,

CRM 2015 – Useful JScript Snippets and Syntaxes

Below are the list of useful scripts and syntax’s

Filter look up records

Let’s consider a scenario, “Primary Contact” lookup on Account form should display only Contacts with “Business Phone” (i.e., Contact.telephone1 != Null)

Steps :

  • Add PreSearch event for ‘Primary Contact’ lookup
  • In the event handler define Filter and set to the lookup using ‘addCustomFilter’ method

Script:

// Attach below ‘onload’ function to Form onload event

function onload() {

Xrm.Page.getControl(“primarycontactid”).addPreSearch(filterCustomerContacts);

}

function filterCustomerContacts() {

//Only show Contacts with ‘Business Phone’

var primaryContactFilter = “<filter type=’and’><condition attribute=’telephone1′ operator=’not-null’ /></filter>”;

Xrm.Page.getControl(“primarycontactid”).addCustomFilter(primaryContactFilter, “contact”);

}

Filter Primary Contact Lookup

Filter Primary Contact Lookup

Get fields of specific types

One of my blog follower asked this question “How to get list of all Option Set fields placed on the form?”.

Below is the Script to get Attributes based on Type or Requirement Level using “Xrm.Page.data.entity.attributes.forEach”

Script:

function onload() {

var requiredAttributeNames = [];

var optionsetAttributeNames = [];

Xrm.Page.data.entity.attributes.forEach(

function (attribute, index) {

if (attribute.getRequiredLevel() == “required”) {

requiredAttributeNames.push(attribute.getName());

}

if (attribute.getAttributeType() == “optionset”) {

optionsetAttributeNames.push(attribute.getName());

}

});

alert(“Required Attributes on the form are : ” + requiredAttributeNames.join());

alert(“Attributes of Type Optionset on the form are : ” + optionsetAttributeNames.join());

}

Callback functions on Save

Saves the record asynchronously with the option to set callback functions to be executed after the save operation is completed.

Script

Xrm.Page.data.save().then(successCallback, errorCallback);

successCallback() {

alert(“Form saved !!!”);

}

function errorCallback(saveErrorResponse) {

if (saveErrorResponse != null) {

if (saveErrorResponse.message != ‘undefined’ && saveErrorResponse.message != null) {

alert(“Error on Save – ” + saveErrorResponse.message);

}

}

}

Get control placed on Header

  • var nameControlInHeader = Xrm.Page.getControl(“header_{fieldname}”);

Get control placed in business process flow

  • var nameControlInBPF = Xrm.Page.getControl(“header_process_{fieldname}”);
  • We can get controls in the active stage.

Hide\Show time portion of Date Control

  • Page.getControl(“createdon”).setShowTime(true/false);

Syntaxes

  • getUserPrivilege – When field level security has been applied to an attribute, determine whether a user has privileges to perform create, read, or update operations on the attribute

Xrm.Page.getAttribute(“name”).getUserPrivilege().canUpdate;

  • getMin – Get the minimum allowed value for an attribute that contains a number

Xrm.Page.getAttribute(“creditlimit”).getMin()

  • getMax – Get the maximum allowed value for an attribute that contains a number

Xrm.Page.getAttribute(“creditlimit”).getMax()

  • getIsPartyList – Determines whether an attribute is a partylist.

Xrm.Page.getAttribute(“to”).getIsPartyList()

  • getAttributeType – Get the type of attribute (i.e., Option set,Text etc…)

Xrm.Page.getAttribute(0).getAttributeType()

  • getFormat- Get attribute’s format. (i.e., Text,URL,Email etc…)

Xrm.Page.getAttribute(0).getFormat()

  • getInitialValue – Get the initial value of a Boolean or Optionset attribute

Xrm.Page.getAttribute(“address1_addresstypecode”).getInitialValue()

  • getMaxLength – Get the maximum allowed length for an attribute that contains a string

Xrm.Page.getAttribute(“name”).getMaxLength()

  • alertDialog – Display a non-blocking alert dialog with a callback function.

var alertDisplayed = false;
Xrm.Utility.alertDialog(
“Showing Alert”,
function () { alertDisplayed = true; }
)

  • confirmDialog – Display a Non-blocking Confirm dialog with different callbacks depending on the button clicked by the user.

var agree = false;
Xrm.Utility.confirmDialog(
“Do you agree?”,
function () { agree = true;},
function () { agree = false; }
);

🙂

Categories: CRM 2015 Tags: ,

CRM 2015 Online Update 1 – Application and Customization changes

In this article I am going to brief about new changes and updates in CRM 2015 online update 1.

Trigger Custom Action from Workflow or Dialog

  • We can invoke a custom action directly from within a workflow or a dialog.
Trigger Custom Action from Workflow

Trigger Custom Action from Workflow

Steps on how to Create and Invoke Custom Action from Workflow

Validate Required Steps in Business Process Flow

  • System will now validate all the required steps in Business Process before moving to next stage.
  • Before Update 1 its possible to bypass validation using SDK calls.
Validate Required Steps BPF

Validate Required Steps BPF

Clear field values with business rules

  • Business rules now let us clear field values, on the client and server
Clear Field Values Business Rules

Clear Field Values Business Rules

Business Process Flow – Move back to previous Stage

  • We can go back to the previous stage in the business process flow regardless of entity type
  • You can choose desired previous stage and click ‘Set Active’.
BPF Cant move to Previous stage - Before Update 1

Cant move to Previous stage before Update 1

BPF Choose Previous Stage and Set Active

With Update choose Previous Stage and Set Active

Date and Time field new behavior

  • We got two new time zone independent behaviors for the Date and Time data type (Date Only and Time Zone Independent).
  • Below are different Formats and Examples.
Date Field Formats

Date Field Formats

Date Field Changes Examples

Date Field Changes Examples

Calculated and Rollup Fields

  • With new updates to Calculated fields we can compute the difference between the two dates by using new built-in functions
  • Note that “Now” operator gives SQL Server Time in UTC not Local System Time.
Calculated and Rollup Fields

Calculated and Rollup Fields

Global Most Recently Used (MRU)

  • With Global MRU, provided an access to most recently viewed records (up to 30 records).
Global MRU

Global MRU

Global MRU Storage

Global MRU Storage

“Older Than X” Enhancements in Advanced Find

  • We can now filter on additional units of time including minutes, hours, days, weeks, and years.
  • The Older Than X clauses can be used with Advanced Find, the saved view editor, and queries that are based on FetchXML.
Advanced Find Older Than Operator

Advanced Find Older Than Operator

Navigation and Themes

Plug-in Trace Logs

  • System administrators and developers can now configure CRM to write trace logs to a new CRM entity – ‘Plug-in Trace Log’.
  • These logs can then be viewed within the CRM web application, also from Advanced Find.
  • We cannot extend the “Plug-in Trace Log entity”. We can only view or delete records of the entity.
  • By default, permission to view the logs is enabled for System Administrators and System Customizers, but can be granted to other users
  • Enabling Activity Tracing
    • We can enable\disable from Settings -> Administration -> System Settings -> Customization
    • Enable Plug-in trace log

      Enable Plug-in trace log

    • The setting provides the following options:
      • Off
      • Exceptions – log messages only if an exception is encountered in the execution pipeline
      • All – log all messages, even if there was no exception.

How is “Plug-in Trace Logs” different from developers logging in to their own custom entity?

  • The problem with writing logs to our own Custom entity is due to the fact plug-ins execute in transaction and the transaction is rolled back whenever an exception occurs anywhere in the event pipeline. As a result, the records written to the custom entity would also be rolled back.
  • And with new ‘Plug-in Trace Logs’ entity, the messages are logged even if an exception is encountered and the rest of the transaction is rolled back

References

🙂

CRM 2015 – Navigation and Themes

With the advent of CRM Online 2015 Update 1, we got much awaited New Navigation Bar pattern (Vertical Stacked Menu) and Themes. New Navigation Bar –

CRM 2015 - Navigation Bar

CRM 2015 – Navigation Bar

Themes –

  • With Themes, We can create a custom look and feel, to our CRM web application.We can change CRM applications
    • Logo
    • Navigation bar color
    • Header color
    • Default entity color
    • Default Custom entity color
    • Control Shade & Border
  • We can define multiple themes, but only one can be set and published as the default theme.
  • The theme customization is supported in Microsoft Dynamics CRM for Outlook
  • To create a new Theme, Navigate to Settings -> Customizations -> Themes
CRM 2015 - Themes

CRM 2015 – Themes

  • We can create your own theme and Publish (Once published, Theme propagates to all Users)
CRM 2015 - Themes (Preview_Publish_Clone)

CRM 2015 – Themes (Preview\Publish\Clone)

  • You can Clone new Theme from existing Theme and Preview
  • “Preview Theme”, sets a cookie in browser allows us to use theme until either you exit the preview or delete cookies.

Below is sample theme I created, I added my own Jpg web resource as ‘Logo’ and got color hexadecimal codes from Color Hex site

CRM 2015 - New Theme

CRM 2015 – New Theme

Deploying Themes across Organizations

  • We cannot include ‘Theme’ in CRM Solutions as Theme is not solution aware.
  • However, you can export the Theme and import it to target solution.
  • The imported theme must be published to take an effect
CRM 2015 - Export Theme

CRM 2015 – Export Theme

Theme Best Practices

Theme Best Practices

Theme Best Practices

Changing Specific Entity Color

  • We can change the color of desired entity in Entity Definition
CRM 2015 - Set Color Of Entity

CRM 2015 – Set Color Of Entity

CRM 2015 - Account Entity Changed to Green

CRM 2015 – Account Entity Changed to Green

CRM 2015 - Set Color Of Entity Limitations

CRM 2015 – Set Color Of Entity Limitations

Refer MSDN Article for more details. 🙂

Categories: CRM 2015 Tags: , ,

How to change Organization in Unified Service Desk (USD) Logon application

We can switch to other Organizations from “USD Logon Application” as below.

  • While launching the ‘USD Logon application’, before it loads, click on ‘Change Credentials’ link
USD - Change Organization

USD – Change Organization

  • Now you get USD Login screen as below. Provide the Organization details you would like to connect
USD - Login Details

USD – Login Details

🙂

Categories: CRM 2015 Tags: , ,

Issues faced while setting up outlook client – CRM 2015

I recently started working on migration project CRM 2011 to 2015.

In this article I am going to focus various issues I encountered during Organization configuration on  Outlook client.

Issues faced with installation

First to go with, I had issues while installing the software. Below are logs from event viewer and logs.

  • Error from installation log: Installation of Microsoft Dynamics CRM for Outlook failed. Exit code: 1603. Result: Fatal error during installation
  • Error from Event Viewer: Product: Microsoft Dynamics CRM 2015 for Microsoft Office Outlook — Error 1309. Error reading from file: ..\PFiles\MSCRM\Client\res\web\_static\_forms\accessprivilegebehavior.js. System error 3.  Verify that the file exists and that you can access it.

Fix :

  • We should clear failed installation components from the system before we proceed with installation, which include Registry Entries and installed software’s from ‘Control Panel’ (Refer answer from this post)
  • Regarding missing “\_forms\accessprivilegebehavior.js” file error, I had to re-download the CRM 2015 Outlook Client from here 
  • Make sure you download correct version (X64 or X36) based on your machine OS version.

Issues faced while configuring organization

Data Encryption feature not activated

  • I got below error with message “There are encrypted fields in the organization database, but the data encryption feature isn’t activated. Contact your Microsoft Dynamics CRM system administrator to activate data encryption. To activate, go to System Settings > Data Management > Data Encryption”
Data Encryption Feature Not Activated

Data Encryption Feature Not Activated

Reason

  • As mine was upgraded project, when we restore/import a database, data encryption is disabled by default, even if it was enabled in the system we took a backup from.
  • This is because the encryption settings are stored in the Configuration database, so the .bak file does not contain these settings

Fix

  • As error message suggests we need to activate data encryption in CRM application “System Settings > Data Management > Data Encryption”
  • But when I opened I got another error ‘Enable the HTTPS protocol and try again’.
HTTPS protocol is required

HTTPS protocol is required

  • But I cannot enable HTTPS immediately so the workaround is set ‘DisableSSLCheckForEncryption’ to True (1) in CRM
Query - Disable SSL Check

Query – Disable SSL Check

 UPDATE DeploymentProperties
SET BitColumn = 1
WHERE
ColumnName = ‘DisableSSLCheckForEncryption’

  • After setting “DisableSSLCheckForEncryption” to 1 using query, come back to ‘Data Encryption’ window and provide any 10 digit key as ‘Encryption Key’ and click ‘Activate’
Provide Encryption Key and Activate

Provide Encryption Key and Activate

  • Note : If current user is not part of ‘PrivUserGroup’ we would get below error. Make sure you add the User to ‘PrivUserGroup’ in Active Directory.
Error if User not part of 'PrivUserGroup'

Error if User not part of ‘PrivUserGroup’

SQL Timeout Error while setting up Organization

  • Since mine was upgraded project which is huge is in size I got SQL time out error while configuring organization using ‘Configuration Wizard’

Fix

Set OLEDBTimeout Reg Key

Set OLEDBTimeout Reg Key

Please do post if you face any other issues.

🙂

Categories: CRM 2015 Tags: ,

Hierarchy Visualization – CRM 2015

December 17, 2014 Leave a comment

With CRM 2015, you can represent self-referenced records in Chart format, this feature called as ‘Hierarchy Visualization’.

If the Entity is configured for ‘Hierarchy Visualization’, a symbol as below will appear for Self referenced records.

Account Hierarichal View

Account Hierarchical View

By clicking the chart symbol you will be redirected to below Chart.

Account Hierarichal View - Tile View

Account Hierarichal View – Tile View

Every rectangle, contain record information called as a ‘Tile’

Here is the video from Dynamics team on how to configure ‘Hierarchical Visualization’.

Quick Points

  • Only below listed Out Of The box entities can be configured as ‘Hierarchical Visualization’.
Hierarchy Enabled Entities

Hierarchy Enabled Entities

  • Business Units are not supported.
  • Only 1:N relationships can be enabled to be hierarchical (Not supported for N:N)
  • Hierarchical settings can be included in Solutions.
  • Record data displayed in tile is from ‘Quick View Form’. Only 4 fields are displayed on a tile excluding Sub-grids & IFrames.
  • Querying Hierarchical Data
    • New commands added in ‘FetchXML’ and ‘Condition Expression’ of ‘Query Expression’, to query Hierarchical data.
    • Querying Hierarchical data not supported with OData end point.
Query Hierarchy Data - New Commands

Query Hierarchy Data – New Commands

  • A new RowAggregate called ‘CountChildren’ has been added which returns Count of Child records for the Current record.
Hierarchy Visualization - Get Child Records Count

Hierarchy Visualization – Get Child Records Count

🙂