7 Replies Latest reply on Feb 24, 2014 1:44 PM by ChrisJohnston

    Update Reference

    ChrisJohnston

      Title

      Update Reference

      Post

           Is this document still the recommended way to update a database when it has been moved to a new location? I have used this method with a moved database and it seems to be image and movie file specific. I had different type of files in the container fields and it seems to prefix them with this “moviewin:/” I had a reference there, and now there is movie player with a reference. I did not want the movie player even with the movies (because I launch them to my player). Is there another prescribed way to update a moved databases container references? Is there a manual way to move each one? Can this be handled via XML? Thanks

      refupdate.png

        • 1. Re: Update Reference
          philmodjunk

               "moviewin:" is a pretty standard "tag" to find in a container field with a reference to a movie file.

               Does the greyed out text matter? Greyed out fields are typically fields of type calculation. Thus they cannot receive imported data, but this should not prevent them from being specified as a match field--though your field names suggest that the data in fileName might not be the same as the data in imagepath.

          • 2. Re: Update Reference
            ChrisJohnston
                 

                      Greyed out fields are typically fields of type calculation. Thus they cannot receive imported data, but this should not prevent them from being specified as a match field--though your field names suggest that the data in fileName might not be the same as the data in imagepath.

                 That is good to know! Thanks

                 At the top of the document they say “This can also happen when moving your solution from one machine to another” am I reading this the wrong way, are they saying not any file referenced in a container but, movie and image files. Is there any prescribe way to do this update on referenced files that are not of this type, All types for that matter? I thought it would just find the path and update it, not change the beginning of the path as well. Or to a simple understanding of what is possible If I take one record that has a reference to a Microsoft Word file, located at C:\myWordFiles. Is there a way to change the location to C:\All\myWordFiles, without having to re-insert it in the container again?

            • 3. Re: Update Reference
              philmodjunk

                   What they are warning you is that "by reference" container field data can be specific to a particular machine. If you move the file to a different machine or open it as a client from a different machine, the correct, valid file path to that referenced file might not be the same as what it was on the other computer and then the container field will fail to find the file.

                   The other computer may be a different OS (Mac file paths start with a volume name, Windows specifies a Drive letter), or it may simple mount/map the shared directory where the file is located differently than the other computer. (This is a key reason why FileMaker 12 offers the new "External Storage" option for container fields...)

              • 4. Re: Update Reference
                ChrisJohnston

                     I totally get the reference part that is exactly what I am trying to do. That is, create databases that are not held down to a static place files live. I just don't see any way to make files of all types easily update if the same exact folder structure is not present on the machine migrated to. The question (I think I am not wording correct) is: Can a container fields location (file it is referencing) be updated via a calculation or some text field? Or does it have to be via the method on this page?

                • 5. Re: Update Reference
                  philmodjunk

                       Wouldn't it make more sense to either use external storage or make sure that each machine maps/mounts to the file in exactly the same way?

                       Then there is nothing to update.

                       But FilePaths in by reference container fields can be updated with replace field contents if you need to make the same type of change to large numbers of records in your table. The trick is to know the exact text currently in the "by reference" container field that would be returned by GetAsText ( Container field) Knowing that, you can treat the container field as a text field and use text functions with the replace fields operation to calculate new filepaths and put them into the container fields in place of the original file path text.

                  • 6. Re: Update Reference
                    ChrisJohnston
                         

                              But FilePaths in by reference container fields can be updated with replace field contents if you need to make the same type of change to large numbers of records in your table. The trick is to know the exact text currently in the "by reference" container field that would be returned by GetAsText ( Container field) Knowing that, you can treat the container field as a text field and use text functions with the replace fields operation to calculate new filepaths and put them into the container fields in place of the original file path text.

                         That sound exactly like what I am talking about. You always extend my knowledge of what is possible in FileMaker and as a programmer! So I guess you mean that I have to treat it as a text field to get the original path and return it as like-a-textfield type via a function that returns text? Correct? hmmm.... I new I would have to write my own script, I am going to work at it.

                    • 7. Re: Update Reference
                      ChrisJohnston

                           You are a master! That did the trick, I post the result hear so others can benefit. As the good advice suggest, I could get the information as text from a container field with store as reference option enabled like so (pic). I then could use the specify button of Replace field contents to insert a new location. The syntax here worked perfect for me every time. Note I was changing the directory from Tutor to Training. As for the need for two paths, It looks like the first one is FileMaker determining its location relative to the files location (the ../ are saying it went up a directory ).

                           Along with the good advice/help I got on this, the question of why not just use external storage or make sure that each machine maps/mounts to the file in exactly the same way? That is a very good question and in an optimum situation I would always make it so. I am concerned with this for the moment when the situation is not optimum. Also I like knowing about this technique and having the option. Now from here it should be very easy for me to build scripts that handle my needs. I don't know if the result had to be wrapped in a GetAsText() but it works for me well every time this way. I did not find any documentation on this and searched for a long time. We are lucky to have a volunteer community leader “PhiilModJunk” who is such a master! Thank You!