# Aging Orders

New orders come into Orderwave with an order state of New. After they are fully fulfilled (each line item on the order is marked as dispatched), the order state is automatically updated to Complete.

If an order was placed over a certain amount of time ago, and is still New, you and your team should review the order to determine what the issue is. Our recommended strategy is that you create a queue for managing aging orders, a filter that can be used to automatically queue these orders, and alerts to keep your team informed.

# Create an "aging" filter for populating queues

  1. Navigate to Orders, and clear the State: "New" filter to start with a fresh filter. Click in the Filter area to start choosing filter, and choose Order Information.
  2. In the field next to the Order Date field, choose the In the range of operator, and click in the Order Date field.
  3. In the date-range pop-up that appears, choose an acceptable date range using relative values, such as 4 Weeks ago to 2 Weeks ago, and click Done.
  4. In the Order State field, choose New, and click Done.
  5. Click in the Filter area to add another filter item.
  6. Choose Queues
  7. Choose the queue named AGING-ORDER, and toggle on the "Exclude" option.
  8. Click the 💾 button to save this filter, and give it the name Aging Orders for Aging Queue

Now that you have a saved filter that will locate orders that are not fully shipped, and are not queued for review, you can automate placing those orders in the AGING-ORDER queue.

# Create a rule for placing the orders in the aging queue

Navigate to Admin > Rules and click the ➕ button to create a new rule. Name the rule AGING-ORDERS-RULE, and create a rule with the following properties:

Section Value Description
Bucket oms/orders This rule only applies to orders.
Trigger on demand We will run this "on demand" from a rules job.
Matching properties The values we will check on the order to apply this rule.
Match Not We want these matching properties to evaluate to "not true".
Field of JSON path to match queues[any].queueCode with operator is Queue code AGING-ORDER.
Choose an action Add it to a queue We want to add this order to the AGING-ORDER queue.
If an error happens Ignore errors and just continue For this rule, running as an rule job, we want to ignore errors.

Save your rule, and remember to enable it.

# Create an automated task to place the orders in the aging queue

Navigate to Admin > Automated Tasks and click the ➕ button to create a new automated task. You will be creating a rules job that finds the orders (using your new filter), and runs a rule on them. This task does not need to run more than once per day, but schedule it according to your needs, remembering that your account may not run concurrent tasks.

Field Value Description
Task Type Rules job The type of job to perform.
Bucket oms/orders The bucket to run this automated task.
Search filter Aging Orders for Aging Queue The filter to perform.
Rule AGING-ORDERS-RULE The rule to perform.

Enable the task, and now you're all set. Your orders, should they sit longer than 2 weeks without being fully shipped, will be placed in this queue.

# Create a rule to automatically dequeue orders from the aging queue

Now that you have automated the process of adding older orders to the AGING-ORDER queue, you should also automate the process of removing orders from this queue as well.

To do this, create a new rule called AGING-ORDERS-REMOVE-RULE

Section Value Description
Bucket oms/orders This rule only applies to orders.
Trigger updated We want to evaluate this rule when orders are updated.
Matching properties The values we will check on the order to apply this rule.
Match All We want these matching properties to evaluate to "not true".
Field of JSON path to match orderState.state with operator is Value to compare: Complete
Field of JSON path to match queues[any].queueCode with operator is Value to compare: AGING-ORDER
Choose an action Remove it from a queue Queue code AGING-ORDER
If an error happens Ignore errors and just continue Again, we want to ignore errors.

Activate this queue, and orders will automatically be removed from this queue when they become complete.

# Create an aging orders alert (optional)

If you'd like to get an email alert on a specific schedule when orders are in this queue, you can setup an alert job. Follow the steps here to create an alert job that finds orders in the AGING-ORDER queue. Send the alert to the appropriate team members.