3 Replies Latest reply on Jan 14, 2011 9:38 AM by philmodjunk

    Copying a portal record from one portal to another..correct way or not?

    Mitch

      Title

      Copying a portal record from one portal to another..correct way or not?

      Post

      Hi I have a parent recrd that has tow main portals.  The portals are very similar in content. 

      I wish to transfer a portal record from one portal, Portal B over to another portal, Portal A. Then delete the original record in Portal B.  Also, both portals contain a field with Repetitions [12].

      I have it working, by simply creating a bunch of $Variables for each filed in Portal B, including the ParentID and each of the Repetitions, followed by a Delete portal Row.  

      Then, creating a new portal record in Portal A.  Setting the values in each of the fields in Portal A with the $Variables, followed by a Commit Records.

      Is this the correct method, or the most efficient way of achieving this...something tells me it is taking the long way round...

        • 1. Re: Copying a portal record from one portal to another..correct way or not?
          philmodjunk

          Why do this in the first place? What problem does that solve for you?

          Often, a change in interface and/or table design can make such a move of data from one table to another unecessary. THere are, just to give one possible alternative, ways to make a record disappear from one portal and appear in the other without actually moving any data, you simply manage either the portal's relationship or a portal filter expression (fileMaker 11 only) to control which portal displays the record.

          • 2. Re: Copying a portal record from one portal to another..correct way or not?
            Mitch

            Hi Phil,

            Portal A maintains records of items in a particular collection or 'collectables'.  With Portal B mantaining records of what is either missing, desirable, or needs to be tracked down and found. There are similarirites in the fileds and their data, but not entirely the same.  Being an item that is missing, there are some details that are unknown.

            The Portal B was an after thought and the database has been working for some time without this function.  Hence me first instinct to set variables to get it working at least....

            The intention is, that once a Portal B record has been found and 'In' the collection, I would like its record to move over to Portal A. Where the record can be finalised and the remaining details added.

            Like I said, there was porbably a better way to achieve this.  

            • 3. Re: Copying a portal record from one portal to another..correct way or not?
              philmodjunk

              The better way is likely not to have separate tables for the second portal. If you put all the data in one table (For records of a "missing" item, those extra fields can be left blank), then you can add a field or two to record the item's status as "missing", "Found", "Desirable" or whatever you need.

              Your two portals can use a filter expression set in the portal setup (FileMaker 11 only) or in their relationships so that Portal A does not show the Portal B records and vice versa. "Moving" a record from Portal B to A is then accomplished simply by changing the status field so that Portal B now excludes the record and Portal A does not. If you use a Portal based Filter expression, you'll also need to refresh the window with the "Flush cached join results" option enabled. This can be done with a script trigger set on the status field in your portal.