5 Replies Latest reply on Nov 13, 2015 1:38 PM by synergy46

    FM 14 commit record .... not working

    synergy46

      I have a membership application. 

      There is a 'one' table called MEMBERS

      and a 'many' table called AWARDS.  The relationship works.

       

      Awards has these fields:

       

      Award

      Date

      Notes


      PKAwards

      FKMember

       

      The problem:

      When I create a layout based on MEMBERS and put an AWARDS portal on it, and then put the Award, Date and Notes fields on the portal it seems to work.  That is, it works until I try and edit the Notes (text field). 

      Doing so generates:

      "Before typing, press Tab or click a field, or choose the New Record menu command.  "

       

      I added a Script Trigger for the layout that would commit records and refresh the window but to no avail. 

      (I can see in debug that it is getting called)

       

      The strange part is that if I edit the Date or Award fields, I can do so without an error. 

       

      Ideas

        • 1. Re: FM 14 commit record .... not working
          keywords

          A question: What makes you think it is the Commit step that is not working? You said the problem is that—

          "I try and edit the Notes (text field). 

          Doing so generates:

          "Before typing, press Tab or click a field, or choose the New Record menu command.""

          Then you say adding a Commit step didn't fix this. Surely it is the original problem you need to address. What does you script debugger say is happening when you try to edit the Notes field? That is where you should start your detective work.

          • 2. Re: FM 14 commit record .... not working
            wimdecorte

            synergy46 wrote:

            That is, it works until I try and edit the Notes (text field).

            Doing so generates:

            "Before typing, press Tab or click a field, or choose the New Record menu command.  "

             

             

            How do you go about editing the Notes field?

            The error is because no field is active to receive the keystrokes.

             

            So if you are using triggers, say OnEntry of the Notes fields, then that triggered script probably does a commit too many and puts the focus away from the field...

            • 3. Re: FM 14 commit record .... not working
              synergy46

              It turns out that I had, in an act of irrational desperation to remove the err message...... and we know how action without thinking usually turns out...)  I had written a commitrecord script that has 2 lines:  commit record and refresh window. 

               

              I ran this script from:  OnRecordLoad, OnRecordCommit, OnLayoutEnter... 

               

              The solution was to JUST use OnRecordLoad.... 

               

              Can you enlighten me as to what the problem was in also using:  OnRecordCommit, OnLayoutEnter etc?  There seems to be a 'clash' between OnRecordLoad and other triggers...???

              • 4. Re: FM 14 commit record .... not working
                wimdecorte

                There is no clash.  Events happen in a very specific order and understanding that order is crucial:

                FileMaker 14 Script Triggers - Soliant Consulting

                 

                Download the test file that comes with that to get familiar with that order.  You will probably find that you do not want to use as many events as you had initially thought.

                 

                Triggers are very powerful, but also very easy to hang yourself - which sounds like what you ran into.

                • 5. Re: FM 14 commit record .... not working
                  synergy46

                  Good link.  Thank Wim