0

I've created Validation rule for Sales Price should be greater than market price on opportunity line item. But it seems this validation rule is not working for decimal values.

Below is simple validation rule:
UnitPrice  <  Market_Price__c

Where Market Price is formula field.

enter image description here

Also this validation is passed on Insert but not allowing on update.

Does anyone knows any workaround or solution for this?

3
  • As per the screenshot , I think the validation rule will fail because UnitPrice equals Market_Price__c.
    – Rohit
    Commented Jul 7, 2023 at 7:07
  • I thought same earlier and tried this vr also. AND( UnitPrice < Market_Price__c , UnitPrice <> Market_Price__c )...But still not working
    – whoisnilu
    Commented Jul 7, 2023 at 7:13
  • That condition will also not satisfy since its validating same criteria than before and another criteria. Since both values are equal Unit Price < MarketPrice will not satisfy and validation rule will not fire. Commented Jul 7, 2023 at 7:46

1 Answer 1

0

Validation rules will generate the error on creation/update when the condition specified is met. In your case both fields contain the same value therefore not satisfying the criteria defined.

UnitPrice  <  Market_Price__c

If you want to take into account when both records are equal use

UnitPrice  <=  Market_Price__c
2
  • <= means if both are equals then validation criteria is true. which is not I want. I want Market Price should be greater than UnitPrice. Validation rule is working if values are not in decimals but somehow failing for decimals values.
    – whoisnilu
    Commented Jul 10, 2023 at 8:54
  • If you want to enforce that Market price should be greater than Unit price you need to prevent them to be equals. Validation rules fires when the condition stated is met so as far as you state what you're trying to accomplish I understand that using <= meets your requirements. Commented Jul 10, 2023 at 9:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .