Modifying Queue Views in CRM

I was recently asked to change the queue views for a client.  At first I thought, "hey, wait a tic... that's just a normal view that any old CRM customizer can modify, right?"  And went directly to the customizations...  No luck.

Apparently, they don't want you to be able to change the queue views.  Queues are not customizable entities.  So, I went into the actual page in the CRM web application (the aspx code) to see what was under the hood.  I didn't have access to the compiled C# code, but maybe I could do something on that actual control.  On the page, I found the queue view's grid, but my heart sank when I found out the entirety of the queue view came from a compiled dll!  I.e. there was no way I could get to the page/control where the actual grid was put together.

I shook my head and gave a ridiculous estimate to the client because of the insanity of what I was going to have to do in order to modify this queue.  Oddly enough, they accepted this lofty estimate.  I kind of hoped they wouldn't, because I didn't want to have to do what they were asking :)

They wanted three major changes: they wanted numbers next to the queues that said how many items were in the queue (like the numbers next to your folders in Outlook that say how many unread items you have in them); they wanted certain queues to be shown to certain people; and they wanted the queue view to have more columns (it only starts with three and offers a very limited amount of information, almost useless, really).

Keep in mind I have no way of accessing any code that does any of what you get out of the box: it's all compiled and accessed through a dll.  Microsoft would never let that code out.

So, what did I do?  I'll tell you:

Step one: putting numbers next to the queues.  I wrote a web service that grabs all the queues available to the logged in user in one method and counts up the number of items in a given queue in another.  So, I parse through the html returned by the dll and then send the queue name (from some TD in some table somewhere in the code) to the second method mentioned before and inject some text in the TD's innerText.  Wow, that's hacky.  But, hey, it works, and the client loves it!

Step two: showing only the queues you want to show to certain people.  Ronald Lemmen had a great blog that listed some JavaScript methods that allow you to get the user ID of the logged in user, get their roles and then test whether or not the user is in a certain role.  That post is located here.  So, that wasn't too difficult to modify to what I needed it to do.  The way I did it was pretty slick, though.  I put together all the roles and queues in two arrays, then created a JavaScript object and assigned queues to roles that way.  An example would be below, granting access to the first five queues to the System Administrator.

var roleNames = new Array("System Administrator", "CEO-Business Manager", "CSR Manager", "Customer Service Representative", "DH CSR", "Marketing Manager", "Marketing Professional", "Sales Manager", "Salesperson", "Scheduler", "Schedule Manager", "SRS Management", "System Customizer", "Test CRM", "Vice President of Marketing", "Vice President of Sales");

var queueNameArray = new Array("DH Engineering", "DH PM", "DH Pro Support", "DH QA", "DH Sales", "DH Support", "DH Training", "IFIX Acctg", "IFIX Dispatch", "MPi Accounting", "MPI Engineering", "MPI Fulfillment", "MPi Implementation", "MPi Installation", "MPi Pend Rel", "MPi PM", "MPi QA", "MPi Support", "MPi Tech-Ops", "MPi Trainers");

var roleSecurities = new Object();

roleSecurities[roleNames[0]] = new Array(queueNameArray[0], queueNameArray[1], queueNameArray[2], queueNameArray[3], queueNameArray[4]);

I then hide all queues and only show them when the user has access to them.

Step three: modifying what columns are in the queue view.  Normally, you would go to the customizations section and just have at it.  The grid views are usually customizable.  For some reason, Microsoft must not want you to modify the queue view.  I had given a large estimate, time-wise, as to how long it would take to get this done, so I set out to do some serious R & D to tackle this problem.  I reeeeeeally didn't want to make another web service to find out what other information was being hidden and then display it.  Injecting a little parenthesized number is quite different from adding columns to a grid view.

I had researched how to get to the queue view and got nothing.  So, I relented and decided to do something in the code.  I needed to see what was available in the queue view, I thought, so I started outputting all the properties of the crmGrid (the ID of the grid on the queue view page).  I had to bring in my own assembly to do this.  I wrote a recursive method to grab the crmGrid and display its properties.  I tried one thing after another and just kept hitting a brick wall

I decided to go back and see if there was anything to be gleamed from Googling modifying the queue view.  I got nothing again, in the way of modifying the queue view, but I did notice this blog.  It gave a way to quickly access views.  It then told about a way to query string hack and get to other views.  I was intrigued, to say the least.

Though the author of the blog did not list the exact queue view number, I knew that there was some JavaScript that was looking at the queue view ID on the page I was working on (Workplace/home_workplace.aspx):

function nodeSelect( sQueueId, sViewId, sMenuId )
{
crmGrid.SetParameter("viewid", sViewId);
crmGrid.SetParameter("qid", sQueueId);
crmGrid.Reset();

resetMenuItems(sMenuId);
}

So, I just alerted sViewId :)

So, the URL you need to modify the queue view is... http://crm/tools/viewEditor/viewManager.aspx?id={00000000-0000-0000-00AA-000010001400}.  Obviously, change "crm" to be your CRM web application URL.

I like obliterating estimates :)

Here's what a normal queue view looks like:

Normal Queue View

Here's what it looks like with some numbers next to the queues:

Queue View With Numbers

And here's what it looks like with all of the columns being shown (most can only be seen when you scroll over, and this is a screenshot so you can't do that, but you get the idea):

Queue View With All Columns

Happy queue view hacking!

Published Thursday, October 18, 2007 4:46 PM by vbullinger

Comments

# re: Modifying Queue Views in CRM

Hi Vince,

fantastic to be able to change the queue view and also easy to call the view manager with this parameter. but how do you in the end publish this customization to become active?

appreciated

markus

Thursday, December 27, 2007 4:24 AM by Markus Schmitz

# re: Modifying Queue Views in CRM

Actually I take my questionback. I could publish the changed queue, by simply publishing all customizations, instead of selecting one. I tried this in the beginning, but git confused, because my test case the "Assigned queue" did not show any changes. Funny enough the "Assigned queue" does not seem to be a queue, because the actual queues show the customizations properly.

Anyway, I did not achieve the desired effect. My problem is, that we are abusing the queues as email system inboxes, to such an extreme, that we are not using outlook anymore, but receive and send emails in CRM only. Unfortunately the queues do not show the from-adress of an incoming email activity. This makes our approach a bit wacky. Also customizing it the queue view did not help, since the queue itself does not have the sender information. The creator seems to be always "system" and not the contact, who send the mail.

Tough luck,

I guess,

Markus

Thursday, December 27, 2007 6:11 AM by Markus Schmitz

# re: Modifying Queue Views in CRM

hi, can u guide me in hiding the queue for an user, as iam new to CRM iam stuck with that

Wednesday, April 16, 2008 2:04 AM by vaani

# re: Modifying Queue Views in CRM

"I then hide all queues and only show them when the user has access to them"

But how do you hide and show queues? Can you explain this?

Monday, May 05, 2008 7:15 AM by slonk0

# re: Modifying Queue Views in CRM

Thanks - this is cool and helped me a lot!

But - I would like to show the owner of the "Regarding" associated record.

But when you modify columns on the queue view, you only get a small amount of fields - and not fields from related records.

Any help on this issue?

Thanks in advance.

Monday, May 26, 2008 4:29 AM by henrik

# re: Modifying Queue Views in CRM

"I then hide all queues and only show them when the user has access to them"

But how do you hide and show queues? Can you explain this?

Can you show code sample...

Tuesday, June 17, 2008 9:35 AM by karisma

# re: Modifying Queue Views in CRM

hi

do you know how to modified column createdon to show date with time?

Thank you

Best regards

Thom

Thursday, July 24, 2008 8:52 AM by Thom

# re: Modifying Queue Views in CRM

A very interesting and infrormative article.

In the first step (showing the number of items in a Queue) you say "I parse through the html returned by the dll and then send the queue name (from some TD in some table somewhere in the code) to the second method mentioned before and inject some text in the TD's innerText." Can you explain a bit more about how you do this. I can write the webservice that returns the number of items in a given queue, but can't see at what point to call it. Eg, is it from an onClick() event handler on the Queues navtree item? Any info about this potentially very useful technique would be really appreciated.

Regards

Mike Feingold

Sunday, September 07, 2008 5:05 PM by Mike Feingold

Leave a Comment

(required) 
(required) 
(optional)
(required)