7 Replies Latest reply on Aug 11, 2017 8:24 AM by philmodjunk

    Script field names changed?




      I've had an odd one happen.  I have a front end and a back end in a system.  When updating the system, I create a copy of both then work on the front end.  (I always back up before copying obviously!).  When I test, the back end gets extra data obviously.


      I've noticed an anomaly now.  This morning I added a few scripts to the front end, using fields which have always been there.  I tested and all worked fine.  As the back end now had extra data as a result of the test, I dropped the original back end into the folder with the modified front end.  The scripts for the front end are now wrong - looking for the wrong field.  All that I did was drop the copy of the good back end into the folder with the modified front end.  The process:


      Delete back end with extra data from working folder

      Copy original back end into working folder


      Anyone seen this before?

        • 1. Re: Script field names changed?

          Where the fields and tables, etc of the two backends exactly the same? Or had you made changes to the schema of the BackEnd of one of the two copies as well?


          FileMaker references data via internal IDs, not the names you see in the scripts workspace and calculation dialogs. If, for some reason, one of the two back ends had fields with different internal IDs from that of the other, it would produce the result you describe.

          1 of 1 people found this helpful
          • 2. Re: Script field names changed?

            Yes Phil, the field numbers, names and tables were exactly the same.  All we did was copy the original version from say an hour ago into the working folder.


            We were working on the front end and just wanted a current version of the database after running some test so deleted the 'test' back end and dropped in the 'original' back end.

            • 3. Re: Script field names changed?

              Without sounding too much like a noob, would I be correct in thinking:


              I create two fields Apple and Cherry.  Does FileMaker call them say 0001 and 0002?  If I created a field called banana, would that then become 0003 or would it look and decide that alphabetically it should be 0002 and make cherry 0003?


              If that's the case I can see where the problem lies.  I take the server file, add fields and then put it back.  If the front end is expected cherry (0002) but actually finds banana instead of cherry, I can see where the problem lies.


              I've always found a front and back end work best as I can drop a new front end in for updates.  This is the first time it's gone wrong and all I can think is I added new fields.

              • 4. Re: Script field names changed?

                No it doesn't work that way. Think of the field IDs like primary keys. Once the ID is assigned to a field, that ID is never changed. That's why I asked if you had made changes to the back end file--such as creating and deleting some fields. You've indicated that isn't the case so I don't really know what else to suggest here other than:


                Run a copy of your files through a recover to see if anything is found wrong with either file.

                Post an issue report over in Report an issue to see if the FileMaker techs have any idea what might have gone wrong with your file.

                1 of 1 people found this helpful
                • 5. Re: Script field names changed?

                  Following up on philmodjunk's the Field ID idea, I would create a layout on the "frontend" with the changing fields (and a few others for reference).  Does the fields change when you swap "backend" files? 


                  Also use the Data Viewer to get the list of field ID's on that layout on your new frontend, e.g.


                  FieldIDs ( Get(FileName) ; Get(LayoutName ) )


                  ...does this field ID list show the same fields for both backend versions? 

                  • 6. Re: Script field names changed?

                    I've found that if I copy both the front end and back end to a safe location, add the new fields to the back end, then drop modified back end and existing front end back into correct location, all seems to work fine. Bizarre!

                    • 7. Re: Script field names changed?

                      If you change the back end, then change the front end to use the new fields/tables from the back end. Your front end now is set to use specific ID's in order to reference that data.


                      If you then open a different copy of the back end and try to make the same changes, it's very easy to make the changes in a different sequence than you did the first time around with the other back end copy. This will then assign different IDs to stuff and you'll get a mismatch if you use the Front End from 1 with the Back End from 2.