3 Replies Latest reply on Feb 3, 2016 6:38 PM by Vaughan

    Error 101 on Set Field script step


      I'm trying to run a script that to update a text field with an unstored calculation field so that the text field can be indexed. This script is set up to run on the server and loop through all records for a table.


      The problem I keep running into is that some of the records yield the 101 - Record not found error when I perform the "Set Field" script step, but this doesn't happen all of the records, only some of them. Any ideas as to why this could be? Even when I tried testing setting the field to a regular text string instead of the calculation field it would produce the error on some but not all of the records.



        • 1. Re: Error 101 on Set Field script step

          Is your script trapping for locked records? Use the Open Record step:




          Set Error Capture [ on ]

          Open Record

          Set Variable [ $error ; Get( LastError ) ]

          Set Error Capture [ off ]

          If [ $error = 0 ]

          Set Field [ whatever ]

          End If


          Go to Record [ next ; exit after last ]


          End Loop


          Also make sure the account running the server script has enough privileges (or set the script to run with full access).

          • 2. Re: Error 101 on Set Field script step

            That was it! The record needed to be open. In the past I haven't needed to use that script step. Do you know generally when that step is required?

            • 3. Re: Error 101 on Set Field script step

              In a multi-user environment I use it every time a record is going to be edited, and plan what to do if the record is locked. The busier the database (more users) the more likely there will be locked records.


              You need to work out what to do if records cannot be updated. Leave them with stale data? Go back and try again?


              You could, for instance, omit all the records that are updated so the found set is left with the locked records, then wait and try again until the found set is empty. You need to face the possibility that there may be one or more records could be locked for an extended period of time (user left database open with an uncommitted record).