February 18, 200916 yr What's the best way to implement a unique dual key index (SQL terms) in FMPro? For example, a company_contact table: with 2 key fields: CompanyID and ContactID CompanyID ContactID ------------------- COMP-001 CONT-001 COMP-001 CONT-002 COMP-001 CONT-002 not allowed (duuplicate) COMP-002 CONT-001 COMP-002 CONT-004 COMP-003 CONT-005 COMP-004 CONT-002 etc. - Jansen
February 18, 200916 yr Newbies Create a new field of type text. This field will serve as the unique key. Add a field calculation of something like CompanyID & "|" & ContactID. Uncheck the "Do not replace existing value for field" option. Check the "Prohibit modification of value during date entry" option. Check the "Not Empty" and "Unique Value" validation options.
February 20, 200916 yr Author RobertTaylor66, One of us must be mixed up. How do you access the following options you mentioned for a "Calculation" type field? 1. "Do not replace existing value for field" 2. "Prohibit modification of value during date entry" 3. "Not Empty" 4. "Unique Value"
February 20, 200916 yr Newbies Please re-read my post. You do NOT want a calculation field. You want a Text field with a calculation (defined on the Auto-Enter tab of the field options dialog). The goal is to create a third field that will automatically be the concatenation of the two other fields. This third field will will enforce the uniqueness for your design.
Create an account or sign in to comment