![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Yikes! What I mean is: I've got a many-to-one relationship, in this case say the _one_ is the Title of a comic book, and the _many_ are the Issues. The Issues record stores the foreign key of the Title record, and does not duplicate any Titles data. Comics titles are particularly annoying because they sometimes have the same name; usually you have to differentiate by a volume number, a starting date, a format, etc. Titles get rebooted every so often. So...in my previous implementation (4D), the user could enter an Issue to an existing Title in a 'new Issue' layout. There was a name field into which the user could start typing a fragment of the Title name (like 'Bat')and then Tab. Upon the Tab a new window would be created which contains all related Title matches in a wildcard search , and whatever other data from each title record was necessary for the user to pick the correct title. Once picked, the title's key would get passed into the Issue's field for that key. Now while working in FM, I've found a number of features which get me close to this capabiliity: the auto-completion, the value lists (combining two fields!), etc. At present I've got a Foreign Key field that shows the Title names in a drop-down list. The foreign key goes into the field, and the name is displayed in a noneditable field. Not the best solution, and not very attractive. I 've got a user-editable key value (bad) and a noneditable name (not great) A kind soul sent me an example where you can type the related Title name directly into a field to get names from the drop-down list. This one's tables are different in that the foreign key isn't required. Changing the field options to allow a dropdown with related Title names (as in the example sent to me) means that the user can actually change those names, after a name is selected and the related record is selected. Not good! It appears that to maintain my table's relationships, and simply have the foreign key stored, requires that the foreign key be the field that the user picks from. Since the relationship requires a key, there's no related Title data available until that key is entered/selected. In the other person's sample, the field options don't require the key. I'm pretty sure that I want to maintain the nice schema and find a solution that's based upon scripting. This presents a few problems, namely there doesn't seem to be an obvious way to trigger scripts by typing and tabbing/entering a field. If I were to open a window with a list, or initiate a search for matching related records (and admittedly I don't know how to do those things yet) I think I'm forced to use a button. There's some vague reference to hidden buttons, but so far nothing that seems right. So if anyone can give me a few pointers, especially in terms of 'how to think in FM' I'd appreciate it. Also a hint as to what function lets you search for records based upon a partial string (Lookup doesn't seem right)! Thanks Mike |
![]() |
| Thread Tools | |
| Display Modes | |
| |