1 Reply Latest reply on Aug 30, 2010 11:47 AM by philmodjunk

    "Insert File" without overwriting existing files



      "Insert File" without overwriting existing files



      I'm new to FM and i'm trying to set up a relational database. I have one table acting as the main page for company management, then a tabbed interface with a portal for storing documents. When I insert documents by right clicking the container field, it inserts the docs to a seperate related table via the contact ID field of the company.

      I tried making an insert file button to make it easier, and it worked by setting the button condition, but it always overwrites the existing file with the new one. Is there a way to automatically create a new record for the file by assigning the company id?

      It's really frustrating me.. I tried making a script to make a new record and set the field as the main's company id, but the id never posts and the file just sits in the new table with new relations to anything.

        • 1. Re: "Insert File" without overwriting existing files

          Try this for a test:

          Put the cursor in the last row of the portal. Then run your insert file script. Does it create a new record and insert the file without overwriting existing files?

          If so, you may need to add just his one line to your insert file script:

          Go To Portal Row [last]

          If you have more than one portal on your layout, you may need to tell FileMaker which portal you are referring to when you tell it to go to the last portal row.

          Use the Name box in Inspector to give your portal a name such as "File Portal".

          In your script:

          Go To Object ["File Portal"]
          Go To Portal Row [Last]
          Insert File [...