Useful resources for up to date news on Dynamics CRM from my end

I just wanted to highlight the fact that CRM is making changes at a very fast pace and there would be lot of useful information coming your way, just like it does to me.

So I had a query recently on what are the best ways you can keep up to date via my blog?

Not many people who follow my blog via email might have noticed that I have a twitter handle as well.

clip_image002

My twitter handle is @msdynamicsblog

This is surely the best way to get my instant tech tweets and retweets.

clip_image004

Then if you are not really into following any kind of instantaneous tweets you can always follow my blog via email.

What is the way of doing it?

On the right hand side of my blog there is a small area to follow my blog via email. Every time I post something new you will have an email.

clip_image005

There are some groups as well:

clip_image007

Then there is yet another way, you can go to the LinkedIn Group named Dynamics CRM 2013/2015/2016 Consultants here.

This is more focused on versions 2013 and up and there is loads of information to consume from here.

I myself administer this group for now but am looking to have more admins, so if you like a bit

of administration work let me know in comments.

clip_image009

Another effective way is to drop me an email if you need information on anything specific and think I can help. Here is my email: deepeshsomani@hotmail.com . Sometimes, might take few days but I do respond on it.

clip_image011

I also have a query/feedback form on Dynamics CRM blogs here

Hope it helps and Happy CRMing!

Advertisement

{ADVANCED CODE TIP}My take on the Key not found exception in Dynamics CRM Plugins

Many times we have been there that we get the exception from our plugins called “The Given key was not found”.

The problem with Dictionary collection is that it doesn’t give the key name when it is not found.

The reasoning which I read on different blog posts, forums and Microsoft is key, value pair can be any type.

So, key name is not given in the exception.

clip_image001

But I wanted to have the key name in the plugin log.

I spent many weeks with this exception in my CRM online project and trying to understand how this can be custom built.

So, I have implemented this change on the plugins:

     string[] Cols = { “name “,“accounttype “};

     Object outValue;

            var fieldsMisssing = string.Empty;

            //Do tracing for key not found exception

            foreach(string str in Cols)

            {

                if(!entity.Attributes.TryGetValue(str, out outValue))

                {

                    fieldsMisssing += str + “,”;

                }

            }

 

            fieldsMisssing = fieldsMisssing.TrimEnd(‘,’);

 

            if (fieldsMisssing != string.Empty)

            {

                tracingService.Trace(“Following keys were not found: “ + fieldsMisssing);

            }

 

The result is I have a log in my Plugin trace whenever there are missing keys (Under Settings-> Plug-in Trace logs):

clip_image001[8]

Hope it helps and Happy CRMing!

{Advanced Code Tip}Creating Atomicity of a Transaction in Dynamics CRM 2015

Consider how many times you have been around in the scenario that you are doing some integration or

a batch job with Dynamics CRM and in the interim there is an exception, so you need to design rollback for your job/integrations.

With Dynamics CRM 2015, designs can be simplified way further. There was a new request type introduced with Dynamics CRM 2015: ExecuteTransactionRequest.

In the example below I have intentionally left an error and I am trying to either create a contact and account together or none.

Exception scenario:

using (var service = new OrganizationService(connection))

            {

                ExecuteTransactionRequest request = new ExecuteTransactionRequest();

                Entity account = new Entity(“account”);

                account.Attributes[“name”] = “Transaction Test”;    

                Entity contact = new Entity(“contact”);

                contact.Attributes[“name”] = “Transaction Test Contact”;         

                CreateRequest create1 = new CreateRequest();

                create1.Target = account;

                CreateRequest create2 = new CreateRequest();

                create2.Target = contact;

                request.Requests = new OrganizationRequestCollection { create1, create2 };

                ExecuteTransactionResponse response =  (ExecuteTransactionResponse)service.Execute(request);

            }

Exception:

clip_image002

In this case, Even account was not created:

clip_image004

After Correction:

   using (var service = new OrganizationService(connection))

            {

                ExecuteTransactionRequest request = new ExecuteTransactionRequest();

                Entity account = new Entity(“account”);

                account.Attributes[“name”] = “Transaction Test”;    

                Entity contact = new Entity(“contact”);

                contact.Attributes[“lastname”] = “Transaction Test Contact”;         

                CreateRequest create1 = new CreateRequest();

                create1.Target = account;

                CreateRequest create2 = new CreateRequest();

                create2.Target = contact;

                request.Requests = new OrganizationRequestCollection { create1, create2 };

                ExecuteTransactionResponse response =  (ExecuteTransactionResponse)service.Execute(request);

            }

Created two of them together:

clip_image002[6]

clip_image004[5]

Hope it helps and Happy CRMing!

{Quick Reference} Top Posts from the Last Quarter

Here is a quick look into my top posts from the last quarter:

Refresh CRM 2013 Form using script

   

{Useful to know}CRM Forms loading too slow: Check OUT this USEFUL list

   

Get/Set currency field values in JavaScript for Dynamics CRM

   

Change Business Process Flow using JavaScript

   

Change color for text fields : Dynamics CRM 2013

   

ERD Generator for Dynamics CRM 2011/2013

   

{New utility}Activity Timeline for Dynamics CRM 2015

   

{Quick Tip}Server side sync vs Email router in CRM 2013/2015: What to choose?

   

Cleared MB2-704 MICROSOFT DYNAMICS CRM APPLICATION CRM 2015 Exam

   

CRM 2013 Create Email error – Cannot open Sql Encryption Symmetric Key because Symmetric Key password does not exist in Config DB.

   

Hope this quick reference helps and Happy CRMing!

{Step by Step}Set up Outlook App for Dynamics CRM in Preview mode

Below post lists steps to set up Outlook App for Dynamics CRM in preview mode:

Step 1:

Go to Office 365 Administration settings-> Admin

clip_image001

Step 2:

Pick Add-ins ad highlighted in the screen.

clip_image003

Step 3:

Click + Icon and Pic Add from the Office store:

clip_image005

Step 4:

Search for CRM for Outlook App:

clip_image007

Step 5:

Click Add

clip_image009

Step 6:

Come back to list of apps and see that CRM for Outlook App is disabled

clip_image011

Step 7:

Enable the App and hit save.

clip_image013

Step 8:

Go to system settings and accept the preview feature:

clip_image015

Step 9:

Set up Server side Sync for the mailboxes you want to enable the App as per my earlier post:

https://dynamicsofdynamicscrm.wordpress.com/2015/07/24/step-by-step-set-up-server-side-sync-with-crm-2015-update-1-online-and-office-365/

Note: Do not forget to enable Synchronization for Tasks, Contacts etc. using Server side sync on the mailbox.

Step 10:

See the Outlook App for CRM in Action:

clip_image017

Hope it helps and Happy CRMing!

{Release Preview} Role Comparison Tool for Dynamics CRM 2015/2015 UR1/2016

This is a little Friday Surprise for you guys!

I had published a few weeks back that the Security Role browser for CRM 2015 will be released with some new features. I am holding it back due to some bug fixes needed on it to get it working.

In the interim though, I got my hands working on one of the thing which always causes so many issues to compare. Comparing Roles.

So, here is a sneak peek into the Role comparison tool:

clip_image002

This one gets a csv out for the Role differences:

clip_image004

How is this, I will release it on the coming Monday. Keep checking my blog!

Very soon, all the utilities i did will be merged in as well Smile as I have reached a point its getting difficult to maintain for me. I needed some Community help, any takers. Please leave details in comments.

Leave your thoughts on the tool as well in the comments, it helps!

Hope this will help and Happy CRMing!

{Quick Tip} Quickly check which browser your users are running Dynamics CRM on!

We live in a world of mobility, tablets and smart phones. Many of our end users install custom browsers on multiple OS platforms and start reporting issues with core CRM functionality.

I end up having this problem many a times, sometimes it is even to do with the version of browser customers/users are using.

clip_image001

This time around I again had CRM not working (even the core functionalities) on a tablet device.

Very quickly I wanted to identify the version of the browser and Safari on IPAD really doesn’t show the link!

So, I found to do a bit of research online and found out this free online website providing this cool service:

Link is here: Click here

For Chrome:

clip_image003

For IE 11:

clip_image005

Hope it helps and Happy CRMing!