If you have a comment on this topic, contact Aptify Documentation. If you want to return to the Aptify Community Site, please click here.

Defining the Sort Order for Entity Find Results


By default, find results are sorted by the entity's ID field is ascending order. However, in some cases, sorting by ID may not be appropriate. For example, it may make more sense to sort Companies record by the name of the Company. Therefore, Aptify allows an administrator to modify the sort order of find results when applicable.

Concerning Sub-Type Entities

This attribute is not applicable to sub-type entities.


This behavior is controlled by the FindOrderBySQL field which can be added to the Configuration -> Attributes tab of any Entities record. An administrator can define an unlimited number of sort order levels for a particular entity by modifying the sort criteria with the FindOrderBySQL attribute using the steps below:

  1. Open or create a view within the Entities service.
  2. Open the entity that you want to configure.
  3. Select the Configuration tab.
  4. Select the Attributes sub-tab.
  5. Click the New icon to create a new Entity Attributes record.
  6. Enter FindOrderBySQL in the Name field.
  7. In the Value field, define the sort criterion, separated by a comma, using the syntax below:
    • First Level Field Name to Sort By DIRECTION(ASC|DESC), Second Level Field Name to Sort By DIRECTION(ASC|DESC),etc. 
    1. In the example below, the FindOrderBySQL has been added to the Persons entity. With these settings, the results returned when running a search for records in the Persons service are first sorted in ascending order by Last Name record and then in descending order by Title.
      FindOrderBySQL Attribute Example 
  8. Click OK and Save and Close the entity record.

 

Copyright © 2014-2019 Aptify - Confidential and Proprietary