FileMaker value list are so simple to add but sometimes hard to use. The problems are about UX. In general end user have no information about ID’s which is so important to db developer. There is an option in FileMaker to show only second field value. Bu it is not enough, the problems are;
1. After the user selects value, he or she see "id" in the field instead of value selected.
2. Auto-enter complete by value list is not works with this method.
Placing id field and value field on top of each other partially solved the first problem. But not enough again, if the user enters the field to change value, it sees the actual id value.
I find a method to nail these problems. I would appreciate your evaluation.
Let me explain my method.
First of all let say my value list will be based on Author table which consists id and FullName fields. And I want to set idf_Author with selecting FullName from Books table.
I have several steps to done;
1. Define a global field (I prefer to define this field in a table named global. So I can use this field whole my solution)
2. Define a relationship with Authors table using global field. (VAL_Global::MyGlobalSelectField = VAL_Authors::FullName)
3. Create value list from VAL_Authors::idf_Author. Select “only show related values” from “VAL_Global” table occurrance.
4. Create another value list that list FullNames.
5. Write triger scripts (see the scripts at the end of the post)
6. Place global field on the layout.
1. Allow entry of field only in browse mode from inspector.
2. Select FullName value list for this field, select auto-enter completion option.
3. Add script triggers
1. OnObjectEnter with parameter: Author::FullName (current value)
2. OnObjectSave with parameter: FieldNameToModify & “¶” & ValueListName
7. Place Auhor::FullName field on top of Global field.
1. Allow entry of field only in find mode from inspector.
// This script will be load initial value
Set Field [VAL_Global::MyGlobalSelectField ; Get(scriptparameter) ]
//This script will get value to my id field from value list. Id field and value list names are paremetric to use same scripts within whole my solution.
Set Field by Name [ parameters first value; ValueListItems ( Get(FileName) ; parameters first value ) ]
I have also added the sample file.
I just wonder if there is better/easier way to accomplish. Or Is this method will be cause any inconvenience.