Is it possible to add a Validation Rule to Orders which checks a certain product name has been added to the order?
Basically the price book includes products a, b and c. If the user selects a certain field on the order then I need to ensure AT LEAST product b is added to the order. The easiest way to do this is to validate that a product exists on the order with the name like "removal".
I have failed so far and I have tried these:
- Adding a Roll Up Summary field on Order Items. This didn't work as product name isn't available. I would then validate that this roll up summaries count was > 1.
- Adding an order product Validation Rule on the product name and order field. This didn't work as it fired when adding products a and c and these can be legitimately added to the order.
- Apex trigger on orderitems, I didn't get too far with this as I struggled with the logic.
Is there a recommended approach to validating order products?