Skip to main content
For a validation rule that checks the record type of a related object, is it best to use the record type ID or the record type NAME?

 

Here is my validation rule on Order Product, which references record type of Order:

 

AND(Order.RecordType.Name = "Sales Order",Product2.Minimum_Order_Quantity__c > Quantity)

 

I need this to work in both Classic and Lightning. If you suggest using ID, do I use the 15 or 18 character ID?
2 answers
  1. Feb 6, 2020, 9:12 PM
    If there is a chance you'll need to apply to > 1 record type in the future, you may want to put to label and then do a contains on the label to compare to record.  then you can just adjust label in the future without touching the validation rule itself.
0/9000