Tag: Microsoft CRM Customizations

18Jul

Sending Text Message Alerts from CRM 2013

I often find users are looking for ways to alleviate the email overload.  Sometimes important emails are missed due to a hectic day.  In some situations a remedy I like to incorporate is the ability to text message a user for events or status changes the user really cares about.  Leveraging Microsoft CRM and cell phone carriers’ email feature, we can offer users the ability to receive critical alerts via text messaging in addition to normal email.

 

Emailing a Text Message

What’s great about this is that you don’t need to install a special add-on to send text message alerts from CRM.  What you will need is the recipients cell phone number and carrier.  Each carrier has a specific text message domain, here’s a list of the most common carriers (full list here):

Carrier Domain
AT&T @txt.att.net
Sprint @messaging.sprintpcs.com
T-mobile @tmomail.net
Verizon @vtext.com

All of the carriers use the format of phone number followed by the domain.  For example to send a text message to a Verizon user, you’d email them 8645551234@vtext.com.

When you send text message alerts from CRM you’ll have the subject in parenthesis (if populated) and the body will be shown right after.  Here’s an example:

image

Read More »

22May

CRM 2013 FetchXML Improvements

With CRM 2013, Microsoft added some awesome improvements to their FetchXML.  For those unfamiliar, FetchXML provides you an easy way to query information out of CRM.  With the CRM 2013 FetchXML improvements you can perform significantly more queries than ever before.   Today I want to show you my favorite new feature which is alias filters.

CRM 2013 FetchXML Improvements – Looking at an Example

Let’s say you wanted to find the number of active accounts without contacts.  With CRM 2013, this is now possible and super simple, here’s how.

To start, let’s query for all of our accounts:

Simple enough, and in my test scenario I get 15,179 records.

To be fair though, we are only looking at active accounts, so let’s add a filter.

This returns 14,589 active records.

Adding our Linked Entity and Alias Filter

Now comes the fun part, with 2013 we can also add to our filter, columns concerning our linked entity.

This returned 839 records.  That means in my CRM environment, I have 839 accounts that do not have any contacts associated.  In my case, I want to list those accounts and find which ones need to be deactivated and/or who from sales I should contact to make sure we get the proper contact information inside CRM.

At this point, the count tells us the number of companies we need to review, but really we want tangible data.  Let’s modify this query to get something we can have someone analyze.

Here I’ve added the telephone and composite address (which pulls line 1, city, state, and zip).  I’ve also limited this to 10 records in case your environment has way more than 800.  The primarycontactid should not return, but I’ve included so you can verify.

 

Looking at our Fetch filter, you may notice a new attribute called entityname.  For some of you, this is pretty exciting and ideas are churning through your head already.  If you’re like me, you have had to perform multiple queries to accomplish similar feats.  Luckily with CRM 2013 we can get to our desired data quicker and easier then ever before.

 

What are some more scenarios?

With the new alias filter option, you can look for:

  • Leads without tasks
  • Contacts without activities
  • Strategic contacts without activities for the last 6 months
  • Contacts for top tier accounts in one city combined with contacts for top tier & important accounts in another city

The last one may seem random, but the more you explore the alias filter the more you will be glad you did.

I hope you enjoy!

 

 

25Apr

CRM 2013 – Aggregate Query Record Limit Exceeded

If you are using my CRM Data Detective or trying to perform aggregate queries against your CRM database, you may occasionally see an obscure error message.

CRM 2013 - Aggregate Query Record Limit exceeded

CRM 2013 – Aggregate Query Record Limit Exceeded

 

The specific message is:

AggregateQueryRecordLimit exceeded.  Cannot perform this operation.

 

CRM 2011 and CRM 2013 by default are limited to performing aggregate queries on less than 50,000 records.  With online, you cannot change this value; however, with on premise or partner hosted you can.  I’d recommend modifying this value to 250,000.

In my experience, CRM easily handles 250,000 records as long as you’re following the hardware specs Microsoft recommends.

Modifying the On Premise Settings

Warning!  If you are unfamiliar with making these changes, ask someone who is familiar for help.  Whenever you are making advanced setting changes, use caution.

To increase the limit, you’ll need to modify:

Database: MSCRM_CONFIG
Table: Deployment Properties
Column: AggregateQueryRecordLimit

To query the current value:

To modify:

 

Here’s an MSDN reference for using C# and/or PowerShell: http://msdn.microsoft.com/en-us/library/gg328128.aspx

 

If you are interested in other limits CRM has, take a look at this:

http://social.technet.microsoft.com/wiki/contents/articles/12601.crm-2011-timeouts-and-limits.aspx

 

I hope you enjoy!

14Feb

CRM DevTools Extension by Sonoma Partners

Blake Scarlavai over at Sonoma Partners built a very cool Chrome add-in called CRM DevTools.  This applies to CRM 2011 UR12+ and CRM 2013 and allows you to quickly find the record’s GUID without having to remember Xrm.Page.data.entity.getId() or typing any of this into the console directly.  The tool also allows you to execute fetch and see the results.  This is a great time saver and something everyone should have in their toolbox.

Here’s an excerpt:

CRM DevTools

CRM DevTools is an extension to Google Chrome which can be found here in the Chrome web store.  This extension provides a variety of tools to help optimize customizing and troubleshooting within Dynamics CRM.

Form Information

CRM DevTools - Form Information

  • Displays the current form’s back-end information
    • Entity Name
    • Entity Id
    • Entity Type Code
    • Form Type
    • Is Dirty
  • Ability to show the current form’s attribute’s schema names
  • Ability to refresh the current form

Current User Information

CRM DevTools - User Information

  • Domain Name
  • User Id
  • Business Unit Id

There is a lot more to what this add-in can provide.  Here’s the original post.  I think this is a great idea and I’m excited to see if more and more functionality is added to this down the road.

11Feb

CRM 2013 – Start Users on a Dashboard vs Personal Wall

Microsoft Dynamics CRM 2013 offers by default a “What’s New” landing page known as the Personal Wall.  The “what’s new” page is a great place to start and is part of the social add-ins Microsoft introduced with CRM 2011.

Personal Wall

Checking out the social aspects of the Personal Wall

 

Although the Personal Wall is great, I often like to start users on a custom dashboard:

Here's an example of dashboard that launches to various entities and summarizes data specific to the user.  A different approach to the Personal Wall.

Here’s an example of dashboard that launches to various entities and summarizes data specific to the user

A dashboard customized around the users day-to-day needs allows for users to quickly see and get to pertinent information.  In my case, my team mainly focuses on the companies, projects and tasks assigned to us individually.

Read More »

26Sep

Introducing CRM Data Detective

With my eyes focused on visual studio, I didn’t even notice her walk into my office.  No knock, no “hello”, just an aura of frustration crashed into one of my pleather chairs.  I looked up to say “hi” and was met with a  silent cry for help.  I’ve seen this look before and knew whatever it was, it wasn’t going to be easy.

Turns out a new customer was coming to us after a failed CRM implementation with another partner.  Doing what I do, I see it every now and again.  This customer, was a really good kid, but unfortunately got mixed up with the wrong crowd.  It happens.  You can’t blame the kid, but sometimes those shiny lights turn out to have a dim glow and user adoption turns into user betrayal.

My colleagues frustrations came from how the configuration was all over the place.  Fields were scattered all over the place; some were used, some were hidden, but all of it was a mess.  We didn’t have a requirements document to fall back on, but we did have one crazy idea to solve this mystery… CRM Data Detective!

CRM Data Detective Landing Page

CRM Data Detective Landing Page

Granted, CRM Data Detective wasn’t our only method, but it clearly helped.  We used the Data Detective to analyze the customer’s CRM environment and got a handle on what attributes we could remove and which attributes needed to be more prevalent on the form.  Another case closed and another happy customer.
18Jan

CRM 2011 – Creating a 3rd-Party Dashboard Widget

The “snapshot view” of Dashboards within CRM 2011 is a phenomenal feature that many organizations neglect.  If in your environment people seem to disregard your dashboard needs, then this should hopefully help add some spice.

Today, we’re going to create a widget for a customizable list of stocks.

image

Although stocks may not apply to your needs specifically, I hope the concept of bringing in data from outside CRM into a dashboard widget will be something you’ll see the need for.

 

Preparing our Entity

To start, we’re going to use the account entity.  Luckily for us, the account entity already contains an attribute for us to use called “Ticker Symbol”.  (Microsoft knew I’d want something cool to blog about in 2013).  So, our first step is to add this stock symbol attribute to our form so we can update any of our publicly traded accounts.

image

 

If you notice, the “Ticker Symbol” field includes a hyperlink.  When the user double clicks the link it will take them directly into the MSN money page for the symbol, which is a pretty cool feature.

Taking this further…

I also went ahead and included an ownership attribute.  This would allow you to use some JavaScript to show or hide the ticker symbol field.  Additionally you can create a view called “Public Companies without a Stock Symbol” to help find newly created companies without stock symbols more easily.  Or you could require the ticker symbol for public companies.  That’s what I love about CRM – wicked flexibility.

Once we have added the field to the form, let’s update a few companies with their appropriate stock symbols.

 

Getting the Stock Symbols out of CRM

Now that our form configuration is done, let’s do a little development work.  I began by building a new Solution called “Stock Widget”.

image

Inside of my solution, I’m using jQuery and JCL.  I also created a listing.html web resource to get started working with.

So far, here is what I have (the final code is available for direct download at the end of the post):

image

 

This is pulling our related companies and creating a URL to query the JSONP service.  The window.open command (line 38) should prompt you to download a text file.  You can then copy and paste the text file into a JSON formatter (e.g.http://jsonformatter.curiousconcept.com/).

A quick aside…

To query the data, we’re using Fetch.  Since I based this query off of the “My Active Companies” view, I went to the advanced find from the view and clicked “Download Fetch”.  This allowed me to mostly copy and paste this fetch into my JavaScript.  I had to add the tickersymbol filter line, but most of my work was already done for me.

Notice also in this file, I’ve established paths within my web resources.  This is good practice for keeping your web resources organized within your environment.

 

Getting the Stock Data

Now, we need to handle the stock results we’re getting back.  From our previous step, we were able to get a nicely formatted JSON set of data.  This step is about calling the JSONP stock service and actually do something with the results.

image

There are three changes in this step we need to make:

  • Add the callback parameter (Line 24).
  • Add our “processStockInfo” function (Lines 43-52).
  • Replace the window.open line with an AJAX call to the JSONP stock service (Line 39).

These changes collectively convert the JSON results into a table with specific stock information.

 

Cleaning up the Widget

Once we have this updated inside our solution, let’s add our widget into a dashboard. Here’s what we get:

image

At this point the widget looks ugly.  Let’s apply some CSS to make this look like it’s a native CRM add-on.

image

Putting it all together, we end up with the following control on our dashboard:

image

 

Going Forward

This post focused on creating a 3rd party widget; however, you could create your own JSONP service to display any kind of data just as easily.

All of the code can be downloaded here:  https://github.com/paul-way/JCL/tree/master/Examples/Stock%20Listing

If you made it this far, I’m sure you’re well versed with knowing CRM stands for Customer Relationship Management.  I’m sure you’re also familiar with the term XRM.  However, instead of thinking about “eXtensible Relationship Management”, I want you to start thinking “eXtensible Relationship Mash-up”.  If that’s too cheesy for you, I at least hope this little demo is a reminder that data doesn’t have to live in CRM for data to be used inside of CRM.

As always follow me on twitter (@paul_way) and let me know if you like it or hate it.  Also, throw some comments out there.

I hope you enjoy!

13Jan

XRM 2011 – Microsoft Dynamics CRM 2011 Style Buttons

Adding a button to a Form is a great way to add additional functionality right where the user is already focused. Today we are looking at a few different approaches to adding a button. First, we’re looking at handling the upgrade for those of you who have already used the 4.0 button inside of 2011 or if you had a 4.0 environment and are upgrading. If you have a clean 2011 environment, then feel free to skip down to the “From Scratch” section.

There is already some code floating around to create a 4.0 style button inside of CRM 2011. The button we’re creating will instead create a CRM 2011 style button (i.e. “Example Button”).

image

 

The CRM 2011 button starts gray and then when the user hovers over it, the button will look like:

image

Read More »

12Jan

CRM 2011 – iFrames & Saving

After spending time on several of the CRM forums, I noticed a few people having trouble with iFrames and saving data inside of the iFrame. While a forum post is a little difficult to write a full response, I wanted to share some insight on capturing the form save event to then trigger a save event inside of your iFrame.

From a business case, this is a fantastic way to tie multiple systems together. If all you are doing is syncing data, then look first at a plugin or scribe. However, if you are looking for the user to interact with multiple systems simultaneously, then an iFrame is a wonderful way to integrated with an existing system. A good example might be where CRM is only storing the summary information and the iFrame contains the details. The user may update the details which should save both the CRM record and the details of the web site.

Prerequisites

First, let’s assume you have an iFrame inside an entity.

Secondly, we need to uncheck the “Restrict cross-frame scripting” check box on the iFrame properties.

image

Lastly, it’s a good idea to make sure our iFrame is using HTTPS to prevent mixed mode security warnings.

 

Talking Directly

If you try to talk directly to the iFrame via something like:

Xrm.Page.ui.controls.get(‘IFRAME_opp’).getObject().contentWindow.document

Unless you are On-Premise, you may encounter the “Access is Denied” warning. This will show itself when dealing with URLs on a different domain (or subdomain). Cross domainscripting is a security feature within the browser. Now an easy fix is to disable the browser settings, but this isn’t a good solution.

 

Messaging

Instead of talking directly, we need send a messages to our iFrame. To send a message, we’d do something like:

Xrm.Page.ui.controls.get(‘IFRAME_opp’).getObject().contentWindow.postMessage(‘test’, “*”)

To receive the message on the iFrame, you need to listen for the message event. Let’s take a look at the JavaScript on our example iFrame page:

 

It is very important to check the origin and the message if you are dealing with publicly facing sites.

If the idea of messaging is new to you, here are some additional resources:

 

The OnSave

To initiate the message from the CRM 2011 form, you need to register an OnSave event from within the “Form Properties”.

image

 

How about .NET Pages?

If your iFrame is an ASPX page, all of this still applies. The only difference is that you want to have an ASP.Net button on your page to call the server side code. Instead of the saveForm event, simply call the click event of the button.

When dealing with server side saves though, you can either post a message back to say “I’m done” which will then complete the CRM save or you can put a set timeout in the onSave on the CRM side.

 

Conclusion

Hopefully you have seen how easy it is to integrate with another web site while inside of CRM 2011. If you have had problems with iFrames in the past, I really encourage you to use iFrames for your integration needs as they can really enhance your users experience and can allow for improved data across systems. I hope you enjoy!

1Dec

CRM 2011–Excessive Sub-Gridding

Sub-grids enhance the user experience by conveniently providing associated information.  Within a sub-grid the user can easily view, create, or modify a related entity.  By default, Microsoft will auto-populate up to four sub-grids.

image

 

One thing to note however is that if the form contains more than four sub-grids, then sub-grids 5+ will contain a message inside the sub-grid “To load x records, click here”.  To populate the sub-grid, the user has to click the refresh button or the link.

image

 

CRM 2011 does this intentionally to make sure the User is presented with the Form as quickly as possible.  Each sub-grid is another Fetch call to the database, so reducing those inherently speeds up the form.

Now what if you only need a few more sub-grids and you are ok with the potential performance trade-off?  Well, let’s add a little JavaScript to auto load all of our sub-grids that didn’t auto load already:

function getLinksWithClassName(classname)  {
var bdy = document.getElementsByTagName(“body”)[0];
var els = [];
var re = new RegExp(‘\\b’ + classname + ‘\\b’);
var lnks = bdy.getElementsByTagName(“a”);

for(var i=0,j=lnks.length; i<j; i++)
if(re.test(lnks[i].className))
els.push(lnks[i]);

return els;
}

var lnksUnloaded = getLinksWithClassName(‘ms-crm-List-LoadOnDemand’);

for (var i = 0; i < lnksUnloaded.length; i++){
lnksUnloaded[i].click();
}

 

Now adding the bottom four lines to our OnLoad event will cause all of our sub-grids to auto-load.  Hope you enjoy!

© Copyright 2012-2014, All Rights Reserved