You need to sign in to do that
Don't have an account?

How to limit Lookup Child records to only one active record?
Trying to create a validation rule that will fire if an active child record (FAR) already exists, (Parent=FA, Child=FAR has Lookup(FA)), and a new child record with the same picklist value is being created. Following is my validation rule that is preventing creation of any new child record, whether or not one exists already:
AND(
Active = True,
OR(
ISPICKVAL(Role__c,"Joint Approver"),
ISPICKVAL(Role__c,"Survivor")
))
Is there a way to perform a Count of a Role__c record so that the validation rule is looking for a Count > 1? Note that Role__c is a picklist with several values, like Survivor, Joint Approver, and Beneficiary. Only Survivor and Joint Approver values are limited to having only one active child record.
AND(
Active = True,
OR(
ISPICKVAL(Role__c,"Joint Approver"),
ISPICKVAL(Role__c,"Survivor")
))
Is there a way to perform a Count of a Role__c record so that the validation rule is looking for a Count > 1? Note that Role__c is a picklist with several values, like Survivor, Joint Approver, and Beneficiary. Only Survivor and Joint Approver values are limited to having only one active child record.
In that case, I would use a simple before insert trigger or, if you're not a developer, a flow that would query the other child records of the parent, check the condition and set a flag on the record for a validation rule to trigger (since as far as I know a flow itself cannot prevent a record from being created)