8 Replies Latest reply on Mar 28, 2014 12:31 PM by cschul

    Container Fields and Pictures

    cschul

      Title

      Container Fields and Pictures

      Post

           I'm really confused on what is going on with my script. I have used the script in the past without any issues with container fields. I am using FileMaker Pro 12 Advance with 12 Server. I'm receiving an error message in the container field saying "This file cannot be found: ******" The * stands for the the file name should be. I'm using external storage and it's open. I did make a relationship between DB1 and DB2.

           Loop

              If [ DB1::ID=DB2::ID ]

                 Set Field [DB1::Picture1; DB2::Picture1]

                Go to Record/Request/Page [Next; Exit After Last]

              Else

                  Go to Record/Request/Page [Next; Exit After Last]

           End Loop

            

            

           Thanks for any help.

        • 1. Re: Container Fields and Pictures
          philmodjunk

               What are you trying to do with this script?

               Are both Picture 1 container fields set up with external storage or is DB2::Picture1 not externally stored?

               If so, might some of the files in DB2 have been inserted or imported with the "Store a reference" option enabled?

          • 2. Re: Container Fields and Pictures
            cschul

                 I'm trying import pictures from DB2 into DB1. 

                 DB2 isn't set up for external. 

                 How do I make sure that all the files are not stored as a reference and simply transferred in the DB1?

            • 3. Re: Container Fields and Pictures
              philmodjunk

                   I'm not actually sure that store a reference files will fail to copy over to an externally stored container field, I'd have to test that and see. Since your target field is not externally stored, this is no longer a relevant concern anyway. But is it possible that you have references to files in DB1 that are no longer valid? (The referenced file was renamed or moved...)

                   It's possible to tell that a container field has a file reference instead of an embedded file but takes a bit of doing. If you defined a calculation field in DB1 with this simple expression:

                   Picture1

                   and select text as the result type. This calculation field will show a file path to a file if "store a reference" was used to insert or import the file.

                   What I see in this script, BTW, looks like something that could be done with a single Import Records operation if you used the "match records in found set" option.

              • 4. Re: Container Fields and Pictures
                cschul

                     I will have to check out what it's doing. I'm not where I can get to the database. 

                     I have tried the import Records as well. I also tried Copy and Paste. Nothing was successful. I'm still getting the message.

                • 5. Re: Container Fields and Pictures
                  philmodjunk

                       I would expect Import Records to produce identical results as your script. I mentioned it as it's a simpler set up.

                       You can check a specific record's container field using FileMaker Advanced's data viewer if you add a watch expression such as:

                       GetAsText ( DB1::picture1 )

                       Can you provide a more detailed description of your database and what you have set up here?

                       Are you getting this on every record or just some records?

                       Do you see it in DB1 or only in DB2?

                       Are both DB1 and DB2 located in the same folder on the same computer?

                       One "if all else fails" option is a looping script that uses export field contents to export Picture1 from DB1 to your computer's temporary folder and then inserts it from the temporary folder into Picture1 of DB2. That might resolve some file reference issues if, as I strongly suspect, you have some container fields with files inserted "by reference".

                        

                  • 6. Re: Container Fields and Pictures
                    philmodjunk

                         A few more questions:

                         Is there a relationship defined linking DB1 to DB2? If so, did you use this relationship?

                         DB1::ID=DB2::ID

                         On the layout that was current when you ran your script, was either "DB1" or "DB2" the text found in "Show Records From" in Layout Setup?

                    • 7. Re: Container Fields and Pictures
                      cschul

                           Can you provide a more detailed description of your database and what you have set up here?

                           The database is a list of products with pictures associated to each of the products. It's about 400k items. This is DB1. DB2 is a list of products has been updated from one of our vendors (Added, removed, or changed). I only wanted to affect the items listed in DB2. This list comes to use via an excel spreadsheet. I have converted the excel sheet to a filemaker pro file. Then I added the container fields based on the file names. The text from the updated list has already been entered as it needs to be quality checked. 

                           Are you getting this on every record or just some records?

                           I'm only getting the message on the items I tried to change.

                           Do you see it in DB1 or only in DB2?

                           The message is only in DB1.

                           Are both DB1 and DB2 located in the same folder on the same computer?

                           DB1 is on a dedicated iMac running as a server. DB2 is on a client machine.

                           Is there a relationship defined linking DB1 to DB2? If so, did you use this relationship?

                           Yes, I did. 

                           On the layout that was current when you ran your script, was either "DB1" or "DB2" the text found in "Show Records From" in Layout Setup?

                           It was DB1 where I ran the script from.

                            

                           I did the GetasText. It looks like its still looking the file as a reference. The path is going to client machine. Which explains why its getting a error. I wonder if I imported the files as a reference rather than on the DB2 itself. 

                      • 8. Re: Container Fields and Pictures
                        cschul

                             I think i got it! Thanks for the help on the troubleshooting. It looks like the DB2 was using just references rather than having the pictures in the database.