By default, assigned work orders are sorted by work order number (WONUM), with the option to switch the sort order between ascending and descending.


Opqo 24.09.0 adds configuration options to add user selectable sort options for assigned work orders.


The work list sort options are specified by the workorder property within the sort property in the general section of the STAUTOSCRIPT.STAMCONFIG automation script in the Maximo environment.  The workorder property contains a list of the sort options to display.


The default work list sort options configuration is as follows:

appConfig = {
  "general": {
    ...
    "sort": {
      "workorder": [
        {
          "attributePath": "wonum"
        }
      ]
    }
  }
}


When more than one sort option is configured, the user is able to select the sort option to use as well as the sort direction.  


Each sort option has the following properties:


PropertyTypeDescription
attributePathStringThe title work order attribute containing the value to sort by.  This may use "dot" notation to identify fields on related objects.

This property is required. 
titleStringThe title of the sort option to display to the user.

This property is optional. If this is not specified, the attributePath will be displayed.
typeStringIndicates the field type.

Valid values are:
  • standard
  • date

date should be used for fields containing date or date/time values. This ensures the dates are compared in a consistent time zone when sorting values.

standard should be used for all other field types.

This property is optional. The default value is standard.
sortNullsStringIndicates where null values should appear in the sort sequence.

Valid values are:
  • start
  • end


This property is optional.  The default value is end.

thenObjectContains a child sort option configuration that describes a secondary sort that is applied when this sort option evaluates two work orders to the same value.  

This property is optional.



Sort options can continue to nest secondary, tertiary etc sort options using then.  When specifying a sort option using then, an additional property can be specified:


PropertyTypeDescription
directionStringAllows the sort option to specify the sort direction that will be used, ignoring the sort direction selected by the user.

Valid values are:
  • ascending
  • descending

This property is optional. If this is not specified, this sort option will inherit the sort direction specified by the user.



For example, the following configuration adds a sort option that sorts by:

  1. Target Finish Date
  2. Work Order Priority, which will always sort in ascending order
  3. Work Order Number, which will always sort in descending order


appConfig = {
  "general": {
    ...
    "sort": {
      "workorder": [
        {
          "attributePath": "wonum",
          "title": "WO #"
        },
        {
          "attributePath": "targcompdate",
          "title": "Finish Date",
          "type": "date",
          "then": {
            "attributePath": "wopriority",
            "direction": "ascending",
            "then": {
              "attributePath": "wonum",
              "direction": "descending"
            }
          }
        }
      ]
    }
  }
}




Note: For more information on Opqo configuration and the role and contents of the STAUTOSCRIPT.STAMCONFIG script, see the Configuration Overview article.



If you have questions please do not hesitate to contact us or create a support ticket for more assistance.