Tag: CRM Development

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!

30Mar

Sending Unresolved Emails

Today we’re looking at sending unresolved emails in CRM.  Have you ever wanted to email someone who is not in CRM?  Sometimes it can be frustrating to have to create a contact or lead record for a person just so you can email marketing material.  Additionally, you may want to avoid cluttering up your CRM system with a “fringe” listing of contacts.  By allowing “unresolved” email addresses to be sent, you can do just that.

In addition to configuring CRM, I’ll demonstrate how to send an email from C# (using the CRM 4.0/2011/2013 SDK).

Configuration required for sending unresolved emails in CRM

To start, let’s look at the system settings we’ll need to change.  Begin by selecting Settings > Administration > System Settings.  This will bring up a prompt, select the “Email” tab and select “Yes” for the “Allow messages with unresolved e-mail recipients to be sent” option.

To send emails to recipients not in CRM, select the "Yes" option.

To send emails to recipients not in CRM, select the “Yes” option.

 

Sending unresolved emails in CRM from C#

Here is an example using late binding:

An early bound example of sending emails, can be found here: http://msdn.microsoft.com/en-us/library/hh210217.aspx

You can also mix and match unresolved addresses or in this next example add the primary address of a specific user:

 

Hopefully these options spark some ideas or resolve a frustration you’re currently facing.

 

12Mar

CRM 2013 Gamification


CRM 2013 Gamification

Today we’re talking about CRM 2013 Gamification.  Before we start, I want you to know that I cringe at the word “gamification”.  Don’t get me wrong, I actually like, believe, and implement gamification; however, gamification has a bad connotation because of how people have hyped and improperly implemented it.  There are fantastic examples of very successful gamification, my favorite being stack overflow.  But for every good example, there are probably dozens of implementations that ended with loyalty backlash and frustrating results.  The good news, is that today I’m going to share with you the secrets of good CRM 2013 Gamification for the low, low price of…

 

An example of what not to include with Gamification in CRM 2013

Imagine staring at this all day…

Congratulations, you’re a Winner!

Sorry, the first thing to know about gamification is: avoid cheesy things!  No one wants blinking or moving graphics.  No one.  Instead of focusing on the negatives though, I want to talk about the things you need in order to get productivity gains coupled with user engagement.

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 »

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!

29Aug

CRM 2011 Form Customization (Part 2)

A while back we looked at customizing the CRM 2011 header and footer.  I got some really positive feedback, but some people were tripped up.  Troubleshooting via blog is difficult, so whenever you have problems feel free to tweet me (@paul_way).  Today, I’m going to go into great detail of changing the form again, but this time we’re going to add a new twist.  Take a look at the before and after:

 

image

Before

 

 

image

After

 

 

Now some of you may be wondering what I changed.  First, we still have the light blue shading on the header.  Secondly, we moved the footer to the left navigation.  User’s may never request changing the color of the forms, but that was intended to show you that you could style the forms any which way you wanted.  Moving the footer to the left hand navigation is quite practical.  Some users may be faced with smaller screen resolutions and this will really free up space if  you intend to put a lot of information in the footer (especially if you are adding to the header already).

 

Step-by-Step

Setting up our Web Resources

The first thing you’ll need to do is create a solution.  I called mine “Form CSS Customization”.  In it we are going to add two web resources.

image

 

For our initial web resource we’ll create is a CSS file:

Take note of the name of  your CSS file, as we’ll use this in a minute.  The CSS file contains the shading on the header as well as some custom table formatting that we’ll use with our JavaScript file.

Now, let’s add our JavaScript file:

function load_css_file(filename) {
var fileref = document.createElement(“link”)
fileref.setAttribute(“rel”, “stylesheet”)
fileref.setAttribute(“type”, “text/css”)
fileref.setAttribute(“href”, filename)
document.getElementsByTagName(“head”)[0].appendChild(fileref)
}

function myFormOnLoad() {
load_css_file(‘/WebResources/cei_/css/case.css’); // don’t forget to change the file!
moveFooterToNav();
}

function moveFooterToNav() {

var tbl = document.getElementById(‘crmNavBar’);
var row = tbl.insertRow(tbl.rows.length);
var cFoot = row.insertCell(0);
var txt = document.createTextNode(‘testing…’);
cFoot.appendChild(txt);
cFoot.id = ‘myCustomNav’;
document.getElementById(‘myCustomNav’).innerHTML = “<table class=’myNavFoot’ cellspacing=’0′ cellPadding=’0′>” +
“<tr><td class=’ftLabel’>Created</td></tr>” +
“<tr><td class=’ftValue’>” + document.getElementById(‘footer_createdby_d’).childNodes[0].innerHTML +
“<br />” + document.getElementById(‘footer_createdon_d’).childNodes[0].innerHTML + “</td></tr>” +
“<tr><td class=’ftLabel’>Modified</td></tr>” +
“<tr><td class=’ftValue’>” + document.getElementById(‘footer_modifiedby_d’).childNodes[0].innerHTML +
“<br />” + document.getElementById(‘footer_modifiedon_d’).childNodes[0].innerHTML + “</td></tr>” +
“</table>”;

}

The JavaScript file is doing two important things.  First, it is injecting the CSS file into the header of the page.  This basically tells the browser to pickup the CSS file as if it was always part of the page.  After loading the CSS file, the JavaScript will append a table to the left area nav bar.  This table is completely custom and you can style it any which way you want.  Be careful using Xrm.Page.getAttribute() here, because even though the field is in the footer it may not be accessible to the Xrm object.  In my case, the attributes I’m using were not on any of my tabs.

Changing the JavaScript

You must change the “load_css_file” function to contain your specific web resource.  To find the web resource name, it’s easiest to look at the CSS web resource inside of CRM:

image

 

Configuring the Form

Now we need to go to the form we are customizing.  The first step is to add everything we want to onto the footer.

image

 

Next, we’ll edit the form properties.

image

When editing the Form Properties, we’ll need to add the JavaScript library and add our onLoad function to the Form OnLoad.  In our example, the function we’re using is called “myFormOnLoad”.

After this, we simply hit OK, Save, and Publish.

 

Reviewing the Finished Product

image

As you can see, we made subtle changes to improve the overall look and feel for the user.  We also provided a real-life situation where you may need to squeak out some additional room for the user.  Hope you enjoy!

© Copyright 2012-2014, All Rights Reserved