Tag: Microsoft CRM Tricks and Tips

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!

 

 

17Feb

CRM 2013 – Copying a Process

Within CRM 2013, processes are incredible.  Since they are great time savers for users, I typically get a lot of positive feedback regarding them.

One feature missing from CRM 2013 is the ability to copy an existing process; however, there is a nice work-around we’ll explore today.  If you are like me and create some fairly in-depth processes, then copying a process should hopefully save you some time.  Let’s walk through how to copy a process:

Copying a Process Step-by-Step

  • First, open the Process you want to duplicate:
    Copying a Process: Opening the Process to Duplicate

    Notice the “Activate As” field

    Read More »

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.

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.
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!

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!

23Aug

CRM 2011–Changing the Form Header and Footer Colors

CRM 2011 has a beautiful default theme.  Microsoft has already organized the CRM 2011 folder structure to support themes, but currently only supplies the Silver theme.  Office 2010 on the other hand contains Silver, Blue, and Black.

themes

 

Today we aren’t going to modify the entire theme, but modify the form header and footer.  The code I’m going to include is a small gradient, but you could choose a solid background or any color you’d like.  I was going to use a Clemson, I mean Customer Effective, Orange, but instead focused more on the blue theme look.

 

Before

before

 

After

after

 

Adding our CSS Web Resource

Granted this change was very minor, but you could do about anything you wanted to with it.  To accomplish this basic change you must first upload a CSS web resource (I named mine new_header.css) with the following styling:

.ms-crm-Form-HeaderContainer{
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffB3CAEC, endColorstr=#fff6f8faE);
}

.ms-crm-Form-Footer{
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffB3CAEC, endColorstr=#fff6f8faE);
background-image: none;
}

Note: The filter property is an IE specific CSS attribute.  It isn’t supported in any other browsers (they will just ignore it), but Internet Explorer 7+ supports it just fine.

 

Modifying the OnLoad

Our next step is to modify the onLoad to inject the CSS file.  We’ll do this by adding the following JavaScript to a web resource:

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/new_header.css’);
}

 

Changing the Form Properties

Finally we need to change the form properties to include this JavaScript web resource in the library and add our “myFormOnLoad” function to the OnLoad Event for the Form:

image

 

Conclusion

After going through this blog, hopefully you will see how easy it is to change the form header, footer, or anything else.  By embedding a CSS file, our ideas are our only limits.  Hope you enjoy!

© Copyright 2012-2014, All Rights Reserved