I am looking for a way to prevent the addition of two records in a related list if one field's value in a second record meets a particular condition. We have a junction object ("Application Product") between a custom object ("Application") and the SF standard "Product" object. The junction object has a lookup to Product, and the "Application Product" record is created via a related list on "Application."
Is there a way to write a validation rule -- or a flow -- that will prevent two records in "Application Product" linked to the same Application from having both Product 1 and Product 2? Other Product combinations are acceptable (e.g., one Application Product is "Product 1" and another is "Product 3"). I've tried a validation rule on Application Product with a VLookup to no avail because there is no way to limit the validation to records linked only to one Application record. A flow would be great via a "Create Application Product" button, and I'm trying to avoid using Apex entirely.
The pseudo code would read: Multiple "Application Product" records can be created against an "Application," but if "Product 1" is selected and saved, another record cannot be saved against the linked Application.