I'm stumped and need some help. I'm trying to create a validation rule that requires the "Product Name" field on the "Product" object (not Opportunity Products) to be unique. When I try to create the rule I get a syntax error that the field doesn't exist. I'm probably missing something obvious.
AND(
NOT(ISBLANK(VLOOKUP(
$ObjectType.Product2.Fields.Name,
$ObjectType.Product2.Fields.Name, Name
))),
OR(
ISNEW(),
ISCHANGED(Name)
)
)
Hello Hilary,
afaik, $ObjectType supports only custom object, that's why your validation would not work.
https://ideas.salesforce.com/s/idea/a0B8W00000GdhhyUAB/expanding-the-vlookup-formula
An older post about possible workarounds:
https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A89VFSAZ
Best
Alex