5 Replies Latest reply on Mar 7, 2014 3:53 AM by gdurniak

    Create New Record Fails ?

    gdurniak

      Basic Question ( hosted on FileMaker 11 Server ) :

       

       

      My script Opens a New Window, Goes to a Layout ( different table ), Creates a Record, and sets a field

       

      But this somehow failed, for a user with Full Access

       

      It seems they got to the Layout, since the field did get set ( into an existing record )

       

       

      How might this fail ?

       

      I tried to make it happen, by being in Layout Mode, or in Manage Database on another machine, or by failing a field Validation, with set Error Capture ON or OFF, but it will not fail

       

      greg

        • 1. Re: Create New Record Fails ?
          mikebeargie

          If you do "show all" then "show omitted only" before your new record creation you can be in a found set of zero. Then after your create record script step add an if statement for "get(foundcount) = 1" to check for the new record. This will at least error check for it, if it's important enough for error checking.

           

          As for the failure itself, do you have custom menu sets that might interfere? What about any layout based or window based script triggers?

          • 2. Re: Create New Record Fails ?
            gdurniak

            No custom menus, and no script triggers

             

            > do you have custom menu sets that might interfere? What about any layout based or window based script triggers?

            • 3. Re: Create New Record Fails ?
              BarbaraCooney

              I've had New Record fail when working live. Manage database on a table with an auto-serial at the same time a user tries to create a record in the table. The table is locked. New Record returns an Error, so not sure what Mike is suggesting with the use of get (foundcount).

              • 4. Re: Create New Record Fails ?
                mikebeargie

                The error check I provided is not dependent on get(lasterror), it's functional error checking based on the user process rather than singular error checking. Of course you could use something like this as well:

                 

                New Record

                If (get(lasterror) > 0 )

                   error action

                End If

                 

                But this is another good reminder not to work on layouts and data in live systems.

                • 5. Re: Create New Record Fails ?
                  gdurniak

                  That is interesting

                   

                  It is only that one condition, and only if an edit dialog is open, even if nothing in the Schema was changed ( dumb ! )

                   

                  Auto Enter Serial must be on, Manage Database is open, AND a dialog is open to edit a field

                   

                  You will get Error 303

                   

                  Auto enter calculated value alone does not trigger an error

                   

                  greg

                   

                   

                  > I've had New Record fail when working live. Manage database on a table with an auto-serial at the same time a user tries to create a record in the table. The table is locked. New Record returns an Error

                  1 of 1 people found this helpful