I'm looking for the most efficient route to script in a validation which requires all tag numbers for a Parent record to be unique, however, the tag numbers can be reused among different Parent records.
Example of good logic:
Parent 1:
Tag #1
Tag #2
Tag #3
Parent 2:
Tag #1
Tag #5
Tag #7
Example of disallowed logic:
Parent 1:
Tag #1
Tag #1 - Must be unique per Parent
Tag #3
Parent 2:
Tag #1
Tag #5 - Must be unique per Parent
Tag #5
Now I am quite advanced with Deluge and I could simply grab all Child records and ensure the tag inputted by the user does not match and existing tag by looping all records. This seems horribly inefficient though, and may not possibly run due to too many method calls, so is there a inbuilt method to "index" the tag numbers efficiently in all the Child records?