6 Replies Latest reply on Mar 29, 2013 3:52 PM by JohnEriksson

    Invoke a script trigger on drag-n-drop



      Invoke a script trigger on drag-n-drop

      Description of the issue

      I started to reply to Drag dropping data between two fields does not activate an OnObjectSave script trigger,  but (1) that thread discusses using a script trigger for data normalization, and (2) the thread is marked as Solved.  I agree that Auto-Enter is an appropriate technique for normalization. But what if the developer (me) really wants to perform a script when a user modifies a field by (1) typing a value into an editable field, (2) pasting a value into that field, or (3) dropping a new value onto the field?  All three techniques modify the field, but only #1 and #2 invoke the trigger script. Arguing that drag-n-drop does not activate the field seems like technical slight-of-hand. I realize I can mimic an On Object Modify script trigger using Auto-Enter and the EventScript or DoScript plug-in (which we could do in FileMaker 9).  If that's the solution for responding to all forms of field modification, why bother with the partial solution offered by On Object Modify script triggers? I encourage the FileMaker team to fix/extend On Object Modify script triggers to recognize drag-n-drop modification of a field.

        • 1. Re: Invoke a script trigger on drag-n-drop

          I think you are agreeing with the thread as taken as a whole.


          I think you are referring to part of my post when you said:


          "Arguing that drag-n-drop does not activate the field seems like technical slight-of-hand."


          Personnally I agree with you! This is not desired behavior for this script trigger and I'm glad to see that TSGal has sent this one up for review.


          I simply was analyzing why the "bug" behaved the way it did. Appologies all around if you saw this as any kind of defense of the current behavior that we encounter when we try to use the on modify script trigger for a field.

          • 2. Re: Invoke a script trigger on drag-n-drop

            I'll confess that, when I opened this new thread, my head was spinning from having reviewed many reports, observations, comments, and examples on several sites.  My "technical slight-of-hand" comment came from what I recall was a FileMaker description of "no trigger on drag-n-drop" as intended behavior.  I should have gone back and verified that.  I can't find it now.


            I see that the Drag dropping data between two fields does not activate an OnObjectSave script trigger is no longer marked as Solved.


            I, too, appreciate TSGal's passing our concerns to the development team.

            • 3. Re: Invoke a script trigger on drag-n-drop

              Ward, PhilModJunk:


              The original case I entered was marked as a duplicate record.  Looking at the original record, the main cause is OnObjectModify cannot activate on a non-active field, so drag-and-drop is talking directly to the database instead of editing an active field object on the layout.


              If more information becomes available, I'll let you know.



              FileMaker, Inc. 

              • 4. Re: Invoke a script trigger on drag-n-drop

                We figured that out.


                However, that leaves a potential hole in our interface design as users can modify data in a field without triggering a script that we want to trigger in every case where the field is modified.

                • 5. Re: Invoke a script trigger on drag-n-drop

                  Here's a real-world scenario that shows the importance of drag-n-drop triggers.


                  During the two days since I opened this thread, I've been testing my new script trigger.  The "before" scenario was a simple drag-n-drop: 


                  1. Mouse down on a favicon in my browser, drag the icon to the FileMaker field, and release the mouse.


                  And window focus was irrelevant, at least on Mac OS X.  Focus can be in either window (or neither window), and the drag-n-drop just works.


                  Here's the "after" scenario:


                  1. Click the browser window to give it focus.
                  2. Select the URL (Command-L or click the URL + Command-A).
                  3. Copy the URL (Command-C).
                  4. Click the FileMaker window to give it focus.
                  5. Click the URL field to make it active.
                  6. Paste the URL ... er ... Option-Paste the URL to paste just the text.

                  This is clearly not an acceptable trade-off to get a script trigger to fire.  Before I hand off the enhanced database to users, I'm going to replace the script trigger with an Auto-Enter calculation that uses an EventScript or DoScript plug-in to perform the desired script.  Sigh.

                  • 6. Re: Invoke a script trigger on drag-n-drop

                         Still no change? I don't get a trigger when I drag a file to a container field in FileMaker 12 either. (Mac)