Archive
Incorrect date (KPI) calculation – Enhanced SLA
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.
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) ‘
- Reset the IIS
Refer this article for more details
🙂
Why my Enhanced SLA not triggering – CRM 2015
I was exploring ‘Enhanced SLA’ feature in CRM 2015. I created my first basic enhanced SLA with below steps
- Created a new 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’
- Set the Failure Duration as ‘5 minutes’ and Warn Duration as ‘1 Minute’
- Activated the SLA
- Created a new Case.
- But no Timer or ‘SLA KPI’ records logged when I expanded ‘Enhanced SLA Details’ section.
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.
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’
- Created a new Case and this time got the OOB Timer and SLA KPI record in sub-grid.
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)
- Go to the ‘Case’ and choose Status = ‘On hold’ and Save
- See the Resolve in set to ‘Paused’
🙂
‘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.
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:
- Download and Install NET Framework 4.5.2 Developer Pack
- Open your Plug-in project Properties from Visual Studio and set ‘Target Framework’ to 4.5.2.
🙂
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
🙂
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”);
}
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; }
);
🙂
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.
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.
Clear field values with business rules
- Business rules now let us clear field values, on the client and server
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’.
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.
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.
Global Most Recently Used (MRU)
- With Global MRU, provided an access to most recently viewed records (up to 30 records).
“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.
Navigation and Themes
- Refer my previous Article
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
- 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
- MSDN Article
- Application New Features – Video
🙂
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
- Now you get USD Login screen as below. Provide the Organization details you would like to connect
🙂
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”
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’.
- But I cannot enable HTTPS immediately so the workaround is set ‘DisableSSLCheckForEncryption’ to True (1) in CRM
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’
- 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.
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
- Add ‘OLEDBTimeout’ REG Key on ‘SQL Server’. (MSDN KB Article)
Please do post if you face any other issues.
🙂
Hierarchy Visualization – CRM 2015
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.
By clicking the chart symbol you will be redirected to below Chart.
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’.
- 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.
- A new RowAggregate called ‘CountChildren’ has been added which returns Count of Child records for the Current record.
🙂