-2

I have this formula for my validation rule that will check for an existing record and then prevent the user from submitting a request if a record has been found. However, I'm having a syntax error when I try to check the syntax. Can someone help?

Here's the formula:

AND(
Certification__c != null, 
Resource_Name__c != null,
Certification__c = 
    [SELECT Certification__c 
     FROM Voucher_Request__c 
     WHERE Resource_Name__c = :Resource_Name__c AND Certification_Result__c = 'Passed' LIMIT 1][0].Certification__c
)

1 Answer 1

0

Welcome to SFSE.

Validation rule does not support SOQL query in the filter criteria, that is why you are getting syntax error.

Depending on the configuration of your custom object, check if one of this workaround may help:

  1. Use VLOOKUP formula in the validation rule to look for matching record

  2. Setup a duplicate rule instead of validation rule

You must log in to answer this question.

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