What is happening is the dropdown field change is just editing the record. What would work better is to not let the user change the name in the record at all.
Create a field, make it global, call it gSearch. Populate it with a value list based on the primary key, and using a concatenated first & last name.
OnObjectModify script trigger to perform the follow script
Set Variable (to id value in global field)
Enter Find Mode (uncheck pause)
Set Field (id field with variable)
Perform Find (no parameters)
to achieve that, add a new field to your table, and make storing global (that means the same value for all records). I can't 'show' you, I am on a PC with no FM installed. Assign the same value list to this new field. When the user pick a choice, then go the corresponding record. On your layout, only make that field editable !
Steve just beat me on this one !
Hi. Welcome to FM & the TechNet community. There are plenty of good training resources available on this website to help you learn to make the most of FM. I would highly recommend Database Skills, FileMaker Pro Training | FileMaker.
To answer your question: to choose records with a dropdown without changing data you need to create a new field - call it "ClientChooser" or something like that. When creating the field, click the options button (bottom right of the Manage Database dialog window) or double click the field to edit it's options. Click the storage tab. Click the "Use global storage" option.
Then place this field on your layout as the chooser field. Set it up as a dropdown list - getting its value from the ClientID field. On you field set script trigger to run the script "OnObjectModify".
The script should now be:
Enter Find Mode [ ]
Set Field [clients::clientID ; clients::ClientChooser ]
Perform Find [ ]
Oh - a couple of other guys got in before me!
Okay, this worked, although it was not intuative how to get both variables into Set Field. It's also not immediately clear that line does. Why is it Clients::clientID first and then the global variable?
The logic of the script is this:
1. Go into find mode.
2. Set a value in the Clients::clientID field that you want to find (in this instance the value that has been selected in the global field - ie. clients::ClientChooser).
3. Perform the Find: ie. Find the record that has a clientID that is the same value as the global field.