#DataTipOfTheDay 2011-02-21Q: "How do I enforce a one-to-one relationship between a Parent record and Child record?" A: Depends on which edition you're using. If you're using Contact Manager, Group, or Professional Edition, this approach works for Master-Detail relationships:*
If you're using Developer, Enterprise, or Unlimited Edition, this approach works for both Master-Detail and Lookup relationships:
For extra credit in either example: create a Lookup Filter on the Child's relationship field that suppresses the display of any Parent with a Child count of one. * Be careful with this approach. As Manpower's Andy Ognenoff and X-Squared On Demand's David Schach pointed out, Rollup Summary Fields are asynchronous. While this approach probably works OK in the UI, data loads through the API could definitely defeat it by loading records before the Rollup Summary Field has time to catch up. Many thanks to Dorset Consulting's Sandra Schanzer for the original tip! |