function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RickoT1031RickoT1031 

RE: Links to support Queues

Hello,


I have written a small visual force function to query the tickets open in each one of our clients, however What I would like to do next is have the results as links to each box (including the analyst) anyone know of an easy way to do this?  I can post my source if necessary

 

Thanks!

bob_buzzardbob_buzzard

Can you expand on what you mean by "have the results as links to each box (including the analyst)"?  I'm not sure what you mean by box and analyst in this case?

 

Posting the source is always a good idea. 

RickoT1031RickoT1031

Ya sorry about that, I figured that may be too vague... So what im doing is I have a query that gets how many tickets are in each Queue then display the results on a sidebar component.  What I would like to add is have each Queue Name and ticket count have a link to the queue that its representing so for example

 

Service Desk - 27 -----> Would link to the Service Desk queue

My Tickets - 18 ------> would link to the analyst's ticket queue

 

 

Maybe I am looking more for a link to a view?

Message Edited by RickoT1031 on 10-20-2009 09:53 AM
RickoT1031RickoT1031

Also... here is the source for my class

 

public with sharing class AllClientQueueStats {

User loggedInUser = [Select id,contactId,Contact.AccountId,Email, Name from User where id = :UserInfo.getUserId()];list<

Group> glookup = [select id, name from Group order by name];

 

Public String getBuildCounts (){

return '<font size=-1><a href="https://cs3.salesforce.com/500?fcf=' + loggedinuser.id + '" target="_top">My Queue - ' + GetMyTickCount() + '</a><br>' + '<a href="https://cs3.salesforce.com/500?fcf=' + GetServiceDeskQueueID() + '" target="_top">Service Desk Queue - ' + GetServiceDeskQueueCounts() + '</a>';

}

 

Public string GetServiceDeskQueueID() {

try{

For (Group x : glookup){

if (x.name == 'Service Desk Queue') {return x.id;}

}

}

Catch (Exception e){return null;} return null;

}

 

Public integer GetServiceDeskQueueCounts() {

try{

For (Group x : glookup){

if (x.name == 'Service Desk Queue') {

return [Select count() From Case c where

(c.OwnerID = :x.Id ) and

(c.Status <> 'Closed') and (c.Status <> 'Resolved')];}

}

}

Catch (Exception e){return null;} return 0;

}

 

public Integer GetMyTickCount() { return [Select count() from Case c where (OwnerID = :loggedInUser.id) and (c.isclosed = False)];

}

 

}

ShikibuShikibu

Yes, I think that what you want are links to list views.

 

In your browser, visit the Cases tab. If you use the pulldown and click "go" to visit a view of cases, you'll get an url like this:

 

https://emea.salesforce.com/500?fcf=00B20000004jAPy

 

Where "500" is the three-letter prefix of the Case object, and the id after fcf is (I think) the id of the list view. If you change the pulldown after clicking "go", the url won't change; you'll need to start again from the Cases tab. 

 

List views have just become accessible as metadata in Winter '10, but I don't think they are accessible from Apex, so you'll probably have to investigate the correct urls in your browser and code them into your apex (or perhaps use new Custom Settings).

RickoT1031RickoT1031

Wouldn't those view links be different for everyone? especially the "My Open Tickets" link no?

ShikibuShikibu
The list view definition has a dropbown box for "filter by owner", and one choice is "My cases". This would be the same view for everyone, but each would only see their own cases.
ShikibuShikibu
See the VF Developer's Guide page about redirecting to standard list pages for a more maintainable way to get the base url.