Next-generation platformDeprecated

Adding custom order statuses to the filter criteria

You can add a custom status to the list of order statuses that are listed as part of the filter criteria in the Order list page.

About this task

The Order search implementation picks the order statuses from a pre-defined list in the sales-order-list-filter.config.ts file. This file is configurable, so you can customize the statuses as required.

Procedure

  1. Create the following folder structure under SCREEN_EXTENSIONS_HOME, if not already present:
    SCREEN_EXTENSIONS_HOME/app/features/orders/config
  2. Navigate to the SCREEN_EXTENSIONS_HOME/app/features/orders/config folder.
  3. Copy the sales-order-list-filter.config.ts file from the <WORKSPACE>/store-frontend/src/app/features/orders/config folder to the <WORKSPACE>/store-frontend/store-extensions-src/app/features/orders/config folder.
    Note: If the sales-order-list-filter.config.ts file is already present in the <WORKSPACE>/store-frontend/store-extensions- src/app/features/orders/config folder, do not copy the file.
    Custom statuses that are used to filter orders are defined in the sales-order-list-filter.config.ts file. For example,
    export const SalesOrderStatusList = [
    {
    'statusCode': 'CUSTOM',
    'statusKey': 'Label_Custom',
    'statusValue': '1100',
    'fromStatus': '',
    'toStatus': ''
    }
    ];

Example

A sample JSON specification that shows various properties for an order status list is given.

You can the override the status by changing the statusKey and the status values.

For translating, you must update the module’s en.json file. For information about adding new translation literals, see Defining a bundle entry for an existing component or module.
Important: Either statusValue or fromStatus and toStatus attributes are required to display a custom status under the filter orders criteria. If these values are not provided, filtering of orders based on custom status does not work.
Attribute Description
statusCode (Required) Unique key to distinguish order statuses in the list and also shown as query parameter in the URL.
statusKey (Required) Description bundle key for status.
statusValue (Optional) Value for the status. Used for absolute status values and is required if fromStatus and toStatus are not provided.
fromStatus (Optional) Starting value of the status. Used for a range of status values and is required if statusValue is not provided.
toStatus (Optional) Ending value of the status. Used for a range of status values and is required if statusValue is not provided.