Background: Find a record by a key field using a global field with a script trigger. Simple, and the users love this feature.
- User enters a number (e.g., 12345) into a global field
- Set variable $wo to the global field
- Enter Find Mode
- Set the key field to "=" & $wo
- Perform Find
But in rare and unexplained (so far) cases the key for the current record is changing to the search parameter. We have two issues at hand:
- Somehow "enter find mode" is not happening, because "set field" is changing the key field
- The key that is set to "prohibit modification during data entry" is changing
It bothers me that a "Set Field" script step can modify a key field that is marked as "prohibit modification during data entry". OK, so this isn't really data entry and it does offer some powerful scripting when you really meant to change a key, but what is the best way to assure that a script never changes a key?
One solution (our current solution since we're punting as the the real problem) is to tell each priv set that they have "View Only" rights to the field they were never allowed to change in the first place.
Any other ways to do this? Is there a situation or hiccup that could happen that would cause the "Enter Find Mode" to fail?
Thanks in advance.