Skip to main content
added 5 characters in body
Source Link
sfdc_beginner1
  • 365
  • 1
  • 6
  • 23

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?

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 "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?

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?

deleted 17 characters in body
Source Link
Adrian Larson
  • 151.3k
  • 38
  • 247
  • 431

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 "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?

Thanks, Alex

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 "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?

Thanks, Alex

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 "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?

Source Link
sfdc_beginner1
  • 365
  • 1
  • 6
  • 23

Order Product Validation Rule

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 "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?

Thanks, Alex