January 5, 201016 yr Hi, I'm trying to make a field act like a "enabled/disabled" under a certain condition. The problem is using the onObjectEnter trigger is not working or there is something I missed. Even if the script returns false, the object gets the focus. Here is my script Freeze Window Set Variable [$typeAdd; Value: 5] if [rep_ADDENDAS::fkTypeID = $typeAdd] Exit Script [Result: True] else Exit Script [Result: False] End If BTW, the script is triggered from a portal field. Thanks for any help.
January 5, 201016 yr A script triggered by OnObjectEnter event runs AFTER the event has been processed, and the script result is irrelevant.
January 5, 201016 yr Author Ok I'm using a workaround by adding a "Go to next field" in the "else" block, but I don't like this code. Is there a better way?
January 5, 201016 yr You could make the field itself a button (but then you cannot tab into it). Edited January 5, 201016 yr by Guest
January 5, 201016 yr Ok I'm using a workaround by adding a "Go to next field" in the "else" block, but I don't like this code. Is there a better way? No. Why don't you like it? That is NOT a "workaround". It is taking control, using the logic you have decided on.
January 5, 201016 yr Author Well you know, in my opinion everything named "Go to" sounds pretty odd. The use of "goto" in the programming world is almost prohibited .
January 5, 201016 yr I don't see how you would program a user interface without using 'go to'. User presses tab, expecting to move to the next field in tab order - how do you move the focus if not by 'go to'? That said, I agree that the solution is not perfect - but until Filemaker allows us to put more conditions in 'Allow field to be entered', the options are rather limited.
January 5, 201016 yr Author it's true that we are quite limited. I wonder how FM manage to keep going at this pace compared to other database system. A lot of FM developpers are getting old and there is not much new FM enthusiast... Anyway that's another story! thanks for helping
Create an account or sign in to comment