2 Replies Latest reply on Jan 13, 2011 9:26 AM by vct

    Set Field script step does not work properly in v10/v11

    vct

      Title

      Set Field script step does not work properly in v10/v11

      Post

      I have a database that have a script to save the edit to the comments.  The users enter the edits in a global field xComment on the Edit layout.  When they click on the Save Comment button, the current value in he xComment should be copied to a text field Comment.

      This script works perfectly in v9, but doesn't work in v10/11.  It appears the the edits in the global field does not get put in the Comment field by the Set field step.  The comment field still has its original value (before edit) after the script runs.

      I tried one solution by adding a Commit Record step at the beginning of the script.  Then the script may work a few times.  It's inconsistent. 

      Any idea of what could be the cause of this problem and any solution?

      Thanks,

      VCT

        • 1. Re: Set Field script step does not work properly in v10/v11
          philmodjunk

          Set field works fine for me and I've used it hundreds of times in FileMaker 10 and 11.

          Perhaps there's a problem with the file. Create a simple two field test file with one field set to be a global field and test that file to see if it works consistently. If it does, you may want to run a recover on your file to see if it's damaged. (Sometimes a damaged file will appear to work correctly with one version of FileMaker and not another, so this may explain why it works with v9.)

          Best practice is not to use a recovered file if you have any alternative such as importing your current data from the recovered file into a clone of an undamaged back up copy.

          • 2. Re: Set Field script step does not work properly in v10/v11
            vct

            My co-worked found the following post in this forum "This record cannot be modified in this window  (Thanks PhilModJunk for the answer to that post!)

            That's the answer to my problem too.  The edit screen is a pop-up window.  I had an Open Record step in the Script that opened the edit screen from the main screen.  The Open Record step executed in the Main screen.  I need to commit that record in the Main screen before I can use the Set Field step to change any field value of the same record from the edit screen.

            I deleted the Open Record step.  Now the scripts are working in v11.