Video Screencast Help

Worker Grid Query Ordering

Created: 23 May 2008 • 9 comments
scott76's picture
0 0 Votes
Login to vote

Have you ever created a query for the helpdesk, set an auto refresh on that page, and then wished there was a way you could set the sort order? This will show you how.

  1. First in your Helpdesk Worker Console click on the Incident Queries link located to the left.
  2. Next locate the Query that you would like to set the search order for. Once you have located that Query click on the edit icon.
  3. Finally edit your expression to include the following statement.

    "Order By workitem_number"

    That will set your query to sort by order number. You may change the last statement in that line to define what column you want to search by. Your search order is now set.

Comments 9 CommentsJump to latest comment

mabdelnabi's picture

I looked everywhere for such thing! Thanks for sharing...

-3
Login to vote
craze's picture

I was looking for this a few months ago, but I asked on the Symantec forums and got the solution. In case anyone is wondering, this works!

-1
Login to vote
Ewentling's picture

Nice tip. In my case, I look at multiple ques as well as the tickets I have assigned to myself. For those of you who also look at multiple ques at once, it may help to sort by workitem_assigned_to_worker_id. This will sort based on the assigned to name.

+5
Login to vote
mboggs's picture

You can also click on the column headers to sort ascending or descending on any column in your grid. Less queries to write, perhaps. :)

+3
Login to vote
jperkins's picture

Is there a way to put the queries in alphabetical order?

-1
Login to vote
Dominique's picture

List of queries to be updated to have the list sorted on the worker page:
Select * from Query
Where expression like ‘%worker_query%’

Worker Query:
Select * from worker_query
to be changed to
Select * from worker_query order by name

WorkerQueryViewList:
Select * from worker_query_view
To be change to
Select * from worker_query_view order by worker_query_name

Restart MSSQLServer Service
Restart IIS

Dom

Dom

+1
Login to vote
JMoreno28's picture

Thanks Dom! I've been trying to figure out a way to do this for a while now. Im assuming this would also work for Quick Incidents.

+1
Login to vote
Dominique's picture

[quote=JMoreno28]Thanks Dom! I've been trying to figure out a way to do this for a while now. Im assuming this would also work for Quick Incidents.[/quote]

Yes it could be done but it will be temporary only as any upgrade, hotfix will overwrite the change. You will need to do it again on the new version, hotfixes, upgrades, repair, etc.....

**** TAKE A BACKUP OF YOUR ALTIRIS_INCIDENTS DATABASE ***

You need to change the queries:
QuickIncidentListAll
QuickIncidentList

they are in the tabel Query in the database Altiris_incidents.

Change QuickIncidentListAll:

SELECT * FROM quick_incident

to

SELECT * FROM quick_incident ORDER BY quick_incident_name

And change QuickIncidentList

SELECT * FROM quick_incident where quick_incident_status = 'a'

to

SELECT * FROM quick_incident where quick_incident_status = 'a' ORDER BY quick_incident_name

Restart MSSQLSERVER service.
Wait 1 mn
Restart IIS
Wait 1 mn

Dom

Dom

+1
Login to vote
drew.ohara's picture

All queries can be set to be alphabetical by adding the 'Order By' statement to the end of the query and putting the fields you want alphabetized after it. Follow the Order By statement with either ASC for ascending order (A-Z/1-9) or DESC for descending order (Z-A/9-1). You can also alphabetize by multiple fields by seperating them with a comma.

For Example:
select workitem_number, workitem_title, assigned_to_worker_name
from hd_workitem_current_view
where assigned_to_worker_name like 'John%'
Order by assigned_to_worker_name, workitem_number ASC

this query will first alphabetize by the assigned workers name and then alphabetize(order) by the incident number. All are in ascending order A-Z and 1-9.

Hope this helps. Good luck.

-1
Login to vote