Error An order must have at least one product when creating a new Order
|Knowledge Article Number||000199544|
Depending on your configuration, you might run into the following issue. Open creating a new Order record, you receive the following error message "An order must have at least one product".
This error message normally shows up when you try to activate an Order without adding products to it first. Only Orders with associated products can be activated. The most common case for this issue, is that you have an Apex Trigger or Workflow that changes the Order status to an Activated status (or a custom Status with under the Activated Category) when a particular criteria is met.
Since you cannot add products until after the Order is created, the creation of the order will fail, because the workflow is attempting to change its status to activated before any products are added. The advice is not to use workflows to change the Order status, since these cannot check whether the order has related products or not. An Apex Trigger, could first check if the Order has products and depending on the result, change the status to Activated.