8 Replies Latest reply on Aug 11, 2009 8:51 AM by philmodjunk

    Paste into Portal Row



      Paste into Portal Row




      I am writing a script so it copies the contents of a field from one record and then creates a new record in a different layout and pastes the contents into a portal row.


      I can get the field to copy and paste into any other field except into the portal row!


      What am I doing wrong?



        • 1. Re: Paste into Portal Row

          Howdy NimbleOne,


          If your script goes to another layout and is to make a record through a portal...


          Why not instead simply go to a layout based on the table that your portal is from and create a new record directly in that table?  Why fight with working through a portal when you can simply go to the table directly?  I think you'll find that to be simpler and less problematic.


          Your next script step can be to go to the layout with the portal if that's where you want to end up.


          Enjoy the day!

          • 2. Re: Paste into Portal Row

            Hi Ninja,


            Thanks for your reply.  I have managed to suss this out now.  But basically I have several tables, and what I have done is when people are viewing records in the asset library section and find what they want and hit the log out button, it copies the asset id and then goes to the dispatch note table selection page where they choose either a new dispatch note or a pending dispatch note, and then either create a new dispatch note or goes to the pending dispatch note and then pastes the library id into the first portal row. 


            If they then go back to the library to look for another asset and follow the above process it pastes the next id and description in the next row.  Anyway, all sorted now!  But thanks for your reply.


            Nimble x 

            • 3. Re: Paste into Portal Row
                 A side note . . . you probably want to avoid the clipboard "copy and paste" and create a variable then use the SetField script step in your new record. Alternately you could use a Script parameter and Get(ScriptParameter) to set the field.
              • 4. Re: Paste into Portal Row

                Hello RickWhitelaw,


                Thank you for you side note ... this is my first attempt at using filemaker, so I"m not overly familiar with what Script Parameter's are. At the moment my scripts read ...








                  Show custom message


                  Show custom message


                  Set Field(LIBRARY::LIBRARY_STATUS; "PENDING"


                  Go to Layout (DISPATCH_NOTE_SELECTION)

                End if


                Then after choosing a new dispatch note or a pending dispatch note the script reads ...


                Go to related record (From table "DISPATCH_NOTE"; Using layout: DISPATCH_NOTE::(DISPATCH_NOTE))

                Go to portal row (Select; Last)

                Paste (Select; LIBRARY_TO_DISPATCH::LIBRARY_ID)

                Go to next field 



                How would I go about replicating the above with your suggestion?


                Many thanks,




                • 5. Re: Paste into Portal Row





                  With something like


                  Set Variable [ $Lib_ID; LIBRARY::LIBRARY_ID ]

                  Then replace


                  Paste (Select; LIBRARY_TO_DISPATCH::LIBRARY_ID)




                  Set Field [LIBRARY_TO_DISPATCH::LIBRARY_ID; $Lib_ID]

                  • 6. Re: Paste into Portal Row

                    Thanks Folks for the advice, I'm using FileMaker Version 7 and I understand that I need version 8 to use the set variable option... bummer!


                    Is there a work around for those of us who are trying to get out companies to upgrade but in the meantime must make do? 


                    Thank you for you time.



                    • 7. Re: Paste into Portal Row

                      Howdy NimbleOne,


                      - Make a new field to work in place of the variable (I call mine "Variable" to avoid confusion).

                      - Do NOT put the field on the layout in question, it is just a temporary data holder.

                      - Use SetField (Table::Variable; xxxx) in place of the SetVariable command.

                      - End your script with SetField (Table::Variable; "" ) to empty the data holder.


                      Thanks to FMP for putting in the SetVariable command...

                      • 8. Re: Paste into Portal Row
                           I'd also make that field a global field.