KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Wildcard choice field
PRODUCT: 4D | VERSION: | PLATFORM: Mac & Win
Published On: August 22, 2002

You can define an automatic relation between 2 tables. For example, you can have a relation from the [Many] table to the [One] Table. In the field that links the [Many] table to the [One] table, you can enter a value. If this value does not exist in the [One] table, i.e. if any record in the [One] table does have this value, 4D will tell you that no record in the [One] table exists with this value. You may proceed and create this record in the [One] table or cancel and try another value.

If your field is a string and do not know which value you may enter, you still use the @ character or combine the @ character with the string that you do want to search. For example, if you do know that the value starts with "Jen", type "jen@". It will find all values that start with Jen. If 4D finds one unique value, it will display the found value. If many records are found, 4D will display a Record dialog and will ask you to pick one of these records.

However, this dialog may display the same value many times. This is because you may have many records in the [One] table that share the same value. This happens when your relation is an N to N relation. In this case, you may need to have a wildcard choice field. By default, the wildcard choice field is the field where the relation ends.

You can define another wildcard choice field for the relation. You can set up this field in the Control Page of the Relation property dialog. To select this field, just highlight it in the Wildcard choice scrollable area. After setting another field as wildcard choice field, the dialog that allows you to select the record will now display the value of this field and may help you choose between these records.