DeathRobot Posted October 29, 2013 Posted October 29, 2013 Hi. I have two fields on a layout. The first is the id field of a related table. It is a dropdown menu that shows a value list which uses the "Also display values from a second field" option so that it shows "name" values instead of the id itself. On top of that field is a second field. It is the "name" field of the related table (edit box, not dropdown). The top field allows entry in both Browse and Find Modes. I allow it in Browse Mode so that it can change color on hover (I didn't want to make it a button because I also need to enter data into it in Find Mode). The top field has a script trigger (onObjectEnter) that checks to see if the user is holding down a modifier key. If they are, it does a GTRR. If not, it just activates the first field (dropdown) using a Go To Object script step. Here's my trouble; if there is already data in the 2 fields, the onObjectEnter script is triggered correctly. However, if the fields are empty, it appears the script is NOT triggered (when I use Script Debugger, the script never starts up.) Any ideas? Thanks very much, Michael
comment Posted October 31, 2013 Posted October 31, 2013 Your description is not quite clear. I think your drop-down field is a local field - i.e. not "the id field of a related table" but a foreign key to the related table. If this is true, then the reason you cannot enter the "top" field while the foreign key is empty is simply because there is no related record yet. 1
DeathRobot Posted October 31, 2013 Author Posted October 31, 2013 Sorry about the inaccurate/unclear desciption. You're correct about it being a local foreign key. Do you know if there is a way (without disabling entry of the top field in Browse Mode) to cause the lower field to activate when the fields are empty? I can do it via tabbing since the bottom field is in the tab order and the top field is not, but ideally I could trigger the dropdown when clicking on the blank top field. Thank you! Michael
comment Posted October 31, 2013 Posted October 31, 2013 I am not sure why you don't want to disable entry to the top field in Browse mode. If you do, you can click-through directly to the bottom field - and you can just as easily attach a script trigger to this field (or make it a button) as the other one. You could also make the top field a button that goes to the top field or the bottom field, according to the current window mode.
DeathRobot Posted October 31, 2013 Author Posted October 31, 2013 I wanted the field to change color on hover, which meant either making it a button or allowing entry in Browse Mode. I didn't realize a button could be enterable by using a script that goes to itself, but that solves everything! Thanks very much! Michael
LaRetta Posted October 31, 2013 Posted October 31, 2013 I didn't want to make it a button because I also need to enter data into it in Find Mode). Just for future, you can allow field entry in Find but not Browse by controlling the checkboxes (Inspector > Data Tab > Field Entry. :-)
Recommended Posts
This topic is 4313 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now