2 Replies Latest reply on Mar 15, 2016 9:18 AM by yamu

    Copy images from one table to another


      I'm developing a FM 14 GO Application, where I have a table with lot's of images which the user made with the camera of the iPad. The "camera and putting the images in a table"-part works great.


      Now the second part of the application is the user have a popover with a portal where all images are listed, each row has a checkbox which can be checked and the popover has a button "insert selected pictures" where all selected pictures should be inserted (as a copy) in another table.

      I tried:


      Set Variable [$Path; Value: "file:" & Get ( TemporaryPath ) & "test.jpg"]

      Export Field Contents [Table1::Containerfield1; "$Path"]

      Insert File [Table2::Containerfield2; "$Path"]


      This works, but not very well. The inserted Picture is not shown as a picture in Containerfield2 instead it is a JPG-Icon with the Filename. When I doubleclick, the image will be shown. And 2nd it doesn't work on the iPad.


      How can I get it right?

      Thanks, Hans

        • 1. Re: Copy images from one table to another

          Don't use "file:" & Get ( TemporaryPath ) & "test.jpg"], just  Get ( TemporaryPath ) & "test.jpg"]

          but it is easier to use set Variable[$var;Table1::Containerfield1]

          and set Field [Table2::Containerfield2; $var]

          (or set Field [Table2::Containerfield2; Table1::Containerfield1]if you have a direct relation between Table1 and Table2


          Hope that helps,


          • 2. Re: Copy images from one table to another

            Thanks! Now it works! Only one question:

            When I use set Variable[$var;Table1::Containerfield1] and I set Containerfield2 to this $var in the same script, it works, but when i make 2 scripts, one for the loop over the portal records and within each step I call a second script for inserting the data in Containerfield2 with Perform Script ["InsertRecords"; Parameter: $RecordID & "¶" & $var & "¶" & $secParam] the image will be inserted as an Icon with a filename. Have I to hexencode or base64encode or such other encoding the parameters?