{Step by Step}Convert CRM Online Trial to Paid subscription using Promo code

First thing most clients do is go for a CRM trial. Then when you buy the subscription here are the ways to apply

if you are using the Promo code option. As the official documentation doesn’t exist for this, I am sharing the steps:

Step 1: Go to office.com/setup365 and sign in using your trial 365 Global office 365 admin user account:

clip_image002

Step 2: Enter the Promo code (25 characters long) after signing in:

clip_image003

Step 3: Enter the service usage address:

clip_image005

Step 4: Confirm the subscription:

clip_image007

Step 5: Check the licenses to be assigned:

clip_image009

Hope it helps and Happy CRMing!

{HAPPY MILESTONE – 251st Blog} 250 Reasons for Dynamics CRM Community to Smile!

I need to thank all my readers and community again today! This time Dynamics of Dynamics CRM is celebrating its 251st post!

I request you to leave me some comments this time around as nowadays I am getting lesser of them.

It serves as a great motivation to keep writing, so don’t forget to do it today if

this blog ever helped you or you learned something!

clip_image001

It’s a tree that just keeps growing and learning!

Happy CRMing!

{ADVANCED FIND TIPS}Using Advanced find – Part 1 on Security roles, users, teams and views

One of the coolest features in Dynamics CRM is definitely advanced find. I have not seen any other product with such great search

capabilities in CRM space for end users, IT pros, Business users alike.

clip_image002

Anyways, let’s come to the core idea. This is part 1 of the mini series and I will start with really simple examples.

Here is an example to find all users who are System Administrator:

clip_image004

This will pull all users who are System administrator in the system:

clip_image006

Next one, finding users who are part of some team:

clip_image008

clip_image010

Way too simple, isn’t it?

Let’s get list of all Views in the system. Want to navigate to customizations area? Wait:

clip_image012

Here, Admin can go and quickly update the ones he or she wants:

clip_image014

Clicking will open View editor, no need to navigate anywhere. Just click Advanced find!

Hope it helps and Happy CRMing!

{Quick Tip} When you need option set text value inside your plugin in Dynamics CRM

Normally when a developer in CRM goes to check Option set value only finds out that the Option Set is stored

as an integer and to get the string value normally people use methods like this one:

Look at the approach at this link:

http://stackoverflow.com/questions/24873581/get-the-string-value-from-optionsetvalue-in-crm-plugin

Doing a metadata call for this.

Metadata calls are more time consuming than value already available in memory.

clip_image001

Well CRM does provide a direct way if you have the entity already retrieved, which most oldies in CRM know:

string optionSetText = entity.FormattedValues[“optionsetname”];

Hope it helps and Happy CRMing!

{C# 6.0 and VS 2015 Quick Tip} Coding Superpowers for CRM developers – Part 3 Code Lens for VS 2015

Part 1 of the post is here: Click here

Part 2 of the series is here: Click here

This is part 3 of the series on new features available with C# 6.0 and Visual Studio 2015. In this post I am going to go through

CodeLens feature on Visual studio 2015.

One of the new cool features with Visual Studio 2015 is Code Maps.

This is not available for Visual studio 2015 community edition.

Here is how to do this:

Just go to the project and Select Show on Code Map:

clip_image002

Below I am giving a run down on the Sample Plugin solution being provided with SDK:

clip_image004

So, what’s the big deal here? Just click expand

clip_image005

And keep expanding to have a great visualization of your code:

clip_image006

Hope it helps and Happy CRMing!

{C# 6.0 and VS 2015 Quick Tip} Coding Superpowers for CRM developers – Part 2

Sometimes there is a long gap between Part 1 and Part 2 of my blog series.

But its just because I want to use the concepts in my projects or POC’s before sharing them.

image

The Part 1 of this series is here: Click here

Part 2 Goes here, the new features which can benefit you!

The new null conditional operator {?.}:

You can do multiple layer null check in one condition, the below snippet checks EntityCollection is not null

and then checks Entities is not null:

  EntityCollection entityCollection = service.RetrieveMultiple(query);

 

                            if (entityCollection?.Entities != null)

                            {

                                // Processing logic

                            }

 

What’s more you can also do null check and also match conditions , the below snippet checks EntityCollection is not null,

then checks Entities is not null and also matches entity count condition:

EntityCollection entityCollection = service.RetrieveMultiple(query);

 

                            if (entityCollection?.Entities?.Count > 0)

                            {

                                // Processing logic

                            }

 

Nameof Operator:

This operator helps you to get the name of a particular type and can be used for handling in exceptions and tracing:

For example:

var entity = service.Retrieve(“account “, new Guid(“B18DFC86-4776-E511-80FC-3863BB343C90”), new ColumnSet(true));

 

                    Console.WriteLine(“Var in entity is of type: “ + nameof(entity));

                    Console.WriteLine(“Attribute collection in entity is of type: “ + nameof(entity.Attributes));

Gives the output:

clip_image001

Exception filters:

In your CRM exception handling you can filter by messages now:

  try

                    {

                        throw new Exception(“CRM Exception”);

                    }

                    catch (InvalidPluginExecutionException ex) when (ex.Message == “CRM Exception”)

                    {

                        //control will not come in this catch block

                    }

                    catch (Exception ex) when (ex.Message == “CRM Exception”)

                    {

                        //control will  come in this catch block

                    }

Hope it helps and Happy CRMing!

{Error resolution} Import Solution Error: 0x80044150 in Dynamics CRM 2015

Recently in a project we were getting the following error:

clip_image002

Log file will show following entry:

clip_image004

A little digging told me that this happened as we changed attribute types keeping the same attribute names.

clip_image006

So, next thing was to compare the types, delete the old fields from target environment.

Import the solution back and this time it was successful.

Hope it helps and Happy CRMing!