Hi Stuart.
What you are looking for is a so called "nested" sorting.
In the above mentioned sorting requirement,
- having the ootb "Request(Incident/Problem Workflow List"
- sorted by column "Request" descending
- and nested column "Sequence" ascending,
- by default,
the following will help (tested in 17.3):
Create a file named cr_wf_sorting.mod in NX_ROOT/site/mods/majic
Content:
MODIFY FACTORY cr_wf {
DOMSET MLIST_STATIC 'sequence=cr desc+sequence asc,cr=cr.ref_num,helper=cr+sequence,assignee=assignee.last_name,start_date,wf_template=wf_template.id' '' STATIC;
};
Due to spaces and length the above line is broken in two lines.
The DOMSET line should be in one line only. There is a space between
...+sequence
and
asc,...
SDM needs to be restarted to make this active.
This setting changes the ootb default SORT BY clause
from
'sequence,cr=cr.ref_num,helper=cr+sequence,assignee=assignee.last_name,start_date,wf_template=wf_template.id'
to
'sequence=cr desc+sequence asc,cr=cr.ref_num,helper=cr+sequence,assignee=assignee.last_name,start_date,wf_template=wf_template.id'
As you can see, for nested sorting you need to use the plus (+) character.
The equation
sequence=...
is needed to map this sorting to the "Seq" column in the GUI so that the sorting arrow of this column gets initialized.
Hope this helps and works
...Michael
Original Message:
Sent: Nov 22, 2022 06:05 PM
From: STUART MATTHEWS
Subject: Change default sorting on list_cr_wf.htmpl page
Does anyone know how to sort on Ref Number or Open Date, or anything other than "Seq" on the list_cr_wf.htmpl form, when viewed via the scoreboard /lsCol (Request/Incident/Problem Workflow List) ?
Original Message:
Sent: Oct 26, 2018 02:35 PM
From: Benoit Laviolette
Subject: Change default sorting on list_cr_wf.htmpl page
Hi all,
Been looking to change default sorting when loading list_cr_wf.htmpl page after searching for workflow tasks on Incident/Request/Problems. I would like default sorting to be : cr and then sequence, newest tickets first (Incident/Request or Problem) and then "Sequence" (from the smallest number to the highest)
Example:
Request number | Sequence
29384 | 10
29384 | 20
29288 | 10
29288 | 20
29288 | 30
And so on... now the default sorting is only on Sequence and requests numbers are shown randomly (when reloading a page it gets different order)
I tried on a separate environment changing default sorting order on "cr_wf" object itself (cr and then sequence) (everything list in the domsets tab) and then restart pdm_publish and starting again. Everything still works but no changes.
I tried also setting a sorting condition on the column itself, but not sure it works well.
<PDM_MACRO name=lsCol hdr="Seq." attr=sequence sort="sequence ASC, cr.persid desc">
Anyone tried that before?
In a request, it has to remain sorted by Sequence also as all tasks are shown in a request (4.2 tab)
Thanks