Your mouse click can only do one thing. Either the click enters the field (if it's not set up as a button) or it performs a script (if it is set up as a button).
OnObjectEnter could be set up to perform this script, but then both tabbing into the field and clicking it perform the script and the Go to Related Records step (GTRR) will prevent you from editing the field.
Is this what you want to be able to do?
Enter data into the field and then perform a GTRR to bring up a set of related records?
If so, try using the OnObjectSave trigger to perform this script after editing data in the field.
If this is not what you want, please explain what you want to do in more detail.
It's almost what I want to do. Using an OnObjectSave trigger makes it so I enter the data, and when I tab out, it'll do a GTRR.
I want to be able to enter data, keep working on the record or navigate to other records.
But once data has been entered on this field, if i click it, then it'll navigate to other records.
The pseudo-code logic would be something like this:
If (not isEmpty(field))
Edit field for data entry
Actually writing that code with an OnObjectEnter works as desired. Only problem is that now I can't modify the data once I filled it, if ever I made a mistake etc.
I think i'll just keep it as a field and put a little button next to it to GTTR. Not aesthetically pleasing but simple and functional.
Thank you for the help!
On trick is to set up the OnObjectEnter trigger script such that shift clicking the field puts the cursor into the field instead of doing the GTRR. Then you have a way to click into the field and edit existing data.
Get ( Modifierkeys) can detect if a modifier key such as shift is down.
That's a great trick, just what i needed!