[Case Management framework] Activity/Case Sorting Fields - Case Services Search API
Question
case-management-framework
Forge component by Platform Maintenace

Hi all,

I am using the search activities inside one of my projects (Case_GetActivities and Case_GetCases to be more specific), and I noticed that the SortField options for both of these are somewhat limited. There are only a handful of supported fields compared to the very amount of fields that these actions return in the result sets; for example, a couple of the more important missing ones are options to sort by Case Definition Name/Id, Activity Label, etc.

In a couple projects, the users are requesting the ability to sort by all fields that are currently shown in the screens that use these actions to fetch data, and I'm finding out that these changes, which are generally very simple to address when using aggregates, can become much more difficult to implement under these circumstances if the specific field I'm looking for isn't supported.

So my question: are new sorting fields for these search actions going to be added sometime soon? Obviously I don't know the details of the implementation, so I don't know how much effort such an addition requires, or if it is more complicated for certain fields, but I'm just curious to know if this is in the plans as having a larger set of options would definitely be very helpful to avoid these kinds of situations, considering end-users will likely see any of the displayed fields as 'fair game' for requesting the ability to sort (and filter too, although that's a whole separate discussion).

Thanks in advance, and I appreciate any related comments or suggestions.

Hi Francisco,

In the CaseSortFieldList

for each sort field if you don't provide the 

CaseFieldSortTypeId - leave it empty 

and only FieldName and Ascending - True \ False

the CMF does the sort.

the constraints to be able to sort is that all the fields needs to be included in the main entity which is used for the CMF. If you have reference fields you need to include the descriptions in the main entity as well to be able to sort by the descriptions. 

Please try this. 

It worked for me.

Hope that it helps you.





Hi Alexandre,

Thank you for your answer; however, it seems that this workaround will only work for the older search actions which are now deprecated. The newest Service Actions don't allow you to enter a FieldName manually (just CaseFieldSortTypeId and Ascending), so it is probably not viable as a long term solution. 

I am also not sure if I would be comfortable having to include the fields in the main Entity, but it's still good to know it's possible for cases where sorting by those specific fields is a hard requirement.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.