Microsoft Dynamics CRM

{SCRIPTING TIP} Refresh CRM form asynchronously when records are changed in Sub-grid in CRM 2015 Update 1

Sometimes I have had the requirement in past to refresh CRM form when things are being added to the record sub-grid. I wasn’t able to achieve a solution in supported scripting prior to CRM 2015 Update 1.

Here is the piece of code which needs to be added to your Form on load which will take care of refreshing the form asynchronously every time anything is added to the subgrid

function onload() {

var gridOnloadFunction = function () { Xrm.Page.data.refresh(false); };

Xrm.Page.getControl(“Subgridname”).addOnLoad(gridOnloadFunction);

}

 

 

Microsoft Dynamics CRM

{QUICK TIP} 4 Reasons to have realistic data for your Dynamics CRM projects!

This post has taken a long time coming. Over time, I have been trying to put down the top benefits that Correct data

provides in any implementation not just specifically CRM. Since CRM is all around Customer or some business data,

it becomes even more relevant to have realistic data for Dynamics CRM development and test environments.

clip_image001

Here are the top 4 reasons why:

DYNAMICS CRM IS PROGRAMMED BY ITS DATA:

Many Dynamics CRM implementations allow high level of flexibility in the way their basic functionality can be used.

Configuration data can dictate control flow, data manipulation, presentation and user interface.

CRM can be configured to fit several business process flows, have role based views, and work (almost) seamlessly

with a variety of tailored experiences to a host of different users.

While business looks to CRM’s configurability to allow them to keep up with the market without being slowed by

the development process, an individual may look for a personalised experience from Dynamics CRM.

PROVIDING REALISTIC TEST DATA EARLY SUPPORTS SCENARIO BASED UNIT TESTS:

If a developer has been provided with a positive set of Data, it becomes easier to program for a positive test case

and also for the negative as well. For example, if a field value is required for a business process and there is a workflow

dependent on the field, positive case is to check that the field value is required whereas a null value received in the

field is a null value and a potential for the entire workflow to fail.

Correct data supports such scenarios based unit tests. In the start, if developer didn’t receive this information,

there is no way to test it until in testing and then the time to fix is more of a re-work which

wasn’t possible to be identified originally.

DIFFERENT TYPES OF DATA COMBINATION HELP IN IMPROVING CODE PERFORMANCE:

Depending on different types of Data combinations provided to the developer, it becomes evident to choose the right option in terms of improving performance of the system in choosing the fastest way to process certain things.

For example, Classic example is if certain filtering can further limit the return to a Query being done in Dynamics CRM

it can help in doing less number of loops. If certain thing was being tried to be done on client side and based on

the available combinations it helps in limiting the client side implementation and taking it to server side.

In other cases, limiting column sets to only return relevant fields can have lot of performance benefits.

HELPS AGILE METHODOLOGY AND QUICK DEMOS:

In a fast paced environment, keeping realistic data in development environment helps achieve quick demos

and also helps in quick transfer to test environment for demos and use migration utility to move data as well.

Hope it helps and Happy CRMing!

Microsoft Dynamics CRM

{Quick Tip} Use the checkbox look and feel that two option fields provide!

I have seen many people trying to find a checkbox field for dynamics CRM forms and have seen lot of unsupported ways of people

trying to achieve one.

Dynamics CRM comes with this feature anyways.

What you need to use are two option fields with some formatting magic:

I am taking the example of a custom form and have put a custom field of type two options called Two options test:

1. Default format of the field:

clip_image001

2. Applying the checkbox look and feel:

Go to Form Editor->double click the field or choose Change properties -> Choose Formatting Tab-> See the section titled Control formatting-> Change it to Checkbox:

clip_image002

Save and publish the form.

The effect is below:

clip_image003

Hope it helps and Happy CRMing!

Microsoft Dynamics CRM

{Error Resolution}The case of the form which stopped loading in Dynamics CRM!

Recently in my project, one of the form just stopped loading. Like somebody told it to:

image

Form was opening properly on Form customization though!

Below is the error trace:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.Web.HttpUnhandledException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #05D793E1Detail:

<OrganizationServiceFault xmlns:i=”http://www.w3.org/2001/XMLSchema-instance&#8221; xmlns=”http://schemas.microsoft.com/xrm/2011/Contracts”&gt;

<ErrorCode>-2147220970</ErrorCode>

<ErrorDetails xmlns:d2p1=”http://schemas.datacontract.org/2004/07/System.Collections.Generic&#8221; />

<Message>System.Web.HttpUnhandledException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #05D793E1</Message>

<Timestamp>2015-09-16T14:36:52.2295028Z</Timestamp>

<InnerFault>

<ErrorCode>-2147220970</ErrorCode>

<ErrorDetails xmlns:d3p1=”http://schemas.datacontract.org/2004/07/System.Collections.Generic&#8221; />

<Message>System.NullReferenceException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #8D983CA7</Message>

<Timestamp>2015-09-16T14:36:52.2295028Z</Timestamp>

<InnerFault i:nil=”true” />

<TraceText i:nil=”true” />

</InnerFault>

<TraceText i:nil=”true” />

</OrganizationServiceFault>

Trying to find out the cause, I remembered that one of the developers had recently changed the type for one of the fields but kept the field name exactly the same from the last one. The change was from type lookup to option set. When I quickly downloaded the formxml, I found that the type there references was still an old one, so during rendering the form engine was going for the toss.

So, to resolve this one was just to remove the field from the form designer, save and publish. Again add the field, save and Publish.

How this happened? Seems two developers were publishing the same form, one with the old type and another with the new one. The last right was old form xml because it was not refreshed for a while. I think Dynamics CRM should match types before publish though!

Anyways, Hope it helps and Happy CRMing!

Microsoft Dynamics CRM

{Quick Tip} When to Pick Option set and Lookups in Dynamics CRM

This post is on when should we use Option set (Pick list field) and when we should use Lookup field in Dynamics CRM when it comes

to using them for making choices, i.e., the end users need to be given a choice of options or a selection.

Working on different projects across different clients, geographies, consultants and developers- I still notice that

people have a tendency to choose this types differently Some example are:

· Category

· Sub-Category

· Territory

· County

· Town

· Country

The list can keep growing.

So, my blog’s main focus is to understand when to pick what:

· Option set Fields:

Ø This should be picked when the number of option set values are smaller (typically up to 10 values).

Ø This should be used when there are not many changes required to the values or new additions to the possible

values is not needed by the users.

Ø Global option sets provide additional benefit of using common type of picklist across different entities.

Ø From user perspective, this should be chosen if end user group intends to pick a set of drop-down values.

clip_image001

· Lookup Fields:

Ø This should be picked when the number of choice values are larger (typically greater than 10 values).

Ø This should be used when there are many changes required to the values or new additions to the

possible values is needed by the users.

Ø Global option sets provide additional benefit of using common type of picklist across different entities.

Ø From user perspective, this should be chosen if end user group intends to pick a set of recently chosen

drop-down values and if not found users are ok to select a search bar to find the intended value.

Ø This should be also user if user intends to search the possible values using wild card searches.

Ø From Relationship perspective, Lookup is a relationship between two entities.

This should be a consideration during field creation.

Ø In Various Grid views, is users intend to be able to click through and reach the option value and the

option has additional details than just display text.

For e.g., Country might have Country code, Description etc.

clip_image002

Some more considerations from a great MVP Jukka Niiranen:

 

image

Hope it helps and Happy CRMing!

Microsoft Dynamics CRM

{Quick Tip}Enabling Windows Identity foundation on Windows 10 machines

In Windows 10 devices, Windows Identity foundation is not an install rather a Windows feature which needs to be enabled.

Recently I got lot of queries that the tools I had created are not working anymore on Windows 10 devices. As I myself ported to Windows 10, I noticed the same as well.

The resolution to this is to enable Windows identity foundation in Windows 10:

Steps below:

· Search for Control Panel on Start Menu:

clip_image001

· Pick Uninstall a Program on the menu(highlighted):

clip_image003

· Pick Turn Windows Features On or Off(highlighted):

clip_image005

· Choose Windows Identity Framework 3.5, Hit Ok:

clip_image006

· Restart the machine and you are done.

ABOUT THE AUTHOR:

clip_image001

Twitter: https://twitter.com/msdynamicsblog
LinkedIn: https://www.linkedin.com/in/deepesh-somani-00296932

Google Play Store:

Trying to Learn Dynamics CRM: Download!

Learn Dynamics CRM App on Google Play store