9 Replies Latest reply on Jun 17, 2017 7:45 AM by ojoip

    Copy field contents only works if field is on a layout?

    bokenrosie

      Title

      Copy field contents only works if field is on a layout?

      Post

           I have a calculated field.  

           Next to it I have a button that is setup "Select entire contents", Go to target field" and "copy"

           If I have the field displayed on the layout it works fine.

           If I don't display that field on the layout it does not copy anything.

            

           Any thoughts?

        • 1. Re: Copy field contents only works if field is on a layout?
          MarcMcCall

               Use the set Variable option.
               Set Variable [$$YourField ; Value: YourTable::YourField]
               Set Field  [YourTable::YourField2; $$YourField]

               Using this you do not have to have the field actually on the layout it just needs to be related to the current record you are on.

          1 of 1 people found this helpful
          • 2. Re: Copy field contents only works if field is on a layout?
            bokenrosie

                 Not sure that does what I need?

                 Right now I have a single button that I click.  It selects the entire calculated field results and puts them in the clipboard.  That is part of what I want, I just think the interface would be more clean if I did not have to display the giant calculated field as I copy the results.

                 If my assumption is wrong then where do I put this set variable calculation?  On the button?

                  

                 Thanks

            • 3. Re: Copy field contents only works if field is on a layout?
              MarcMcCall

                   You would need to build a simple script and then on your button have it perform the script. With a script you can have more functionality instead of just one step.

              • 4. Re: Copy field contents only works if field is on a layout?
                philmodjunk

                     Yes, the field must be present on the layout with Browse mode access enabled before Copy will work. This is also true of the Paste Script Steps and the script steps that start with "Insert". You can, if using FileMaker 12 or later, move the field to the right so that it is on the layout but beyond the right hand edge of the layout. In earlier versions, you can hide the field by making it very small.

                     But copying data to the clipboard is not the best thing to do except for very specific reasons such as copying the data to the clipboard so that the user can paste the copied data into another application. If you are moving data from one location to another within a FileMaker Database system there are better options such as what Marc has recommended here. There are also other options available.

                     In addition to the issue with having to have the field on the layout, copying data to the clipboard destroys any data that the user may of copied. It tends to irritate and confuse users when data they have copied (perhaps while using a completely different application) is mysteriously replaced by other data each time that they run a script in FileMaker.

                • 5. Re: Copy field contents only works if field is on a layout?
                  bokenrosie

                       I should have been more clear initially.  I never imagined a scenario where copy and past within FileMaker would have been used.

                       I am, indeed, copying formatted information from FileMaker over to a web interface that has no data validation options.

                       I'm using FM Pro v 12.  I tried moving the field I want to copy off to the right of the layout but that does not appear to work.

                       I exposed just a bit of it and sure enough that works, but it highlights the text in the field and takes me away from where I want to be.

                       I have about ten places where I need to copy this calculated text out of FM to take to another application so the script method seems inefficient.

                  • 6. Re: Copy field contents only works if field is on a layout?
                    MarcMcCall

                         Phil may have to help you with the rest of this one, but now that you have provided some more details as to what you really need to do it should be a lot more straight forward trying to assist you.

                    • 7. Re: Copy field contents only works if field is on a layout?
                      philmodjunk

                           Once your Copy script step has executed a go to field or go to object field can put the data somewhere else.

                           I have a Layout where I attempt to preserve field contents by pasting to and copying from a pair of global fields (one text and one a container). I keep them off the right hand edge and am able to copy to and paste from it with no trouble.

                           As an experiment, I moved one of the two fields into the layout and set it's Hide When Property (New FileMaker 13 feature) to True so that it is always hidden. I found that I could paste to and copy from the field with no trouble.

                      • 8. Re: Copy field contents only works if field is on a layout?
                        philmodjunk

                             PS. I am using a script to copy and paste the data. I am not manually copy/pasting.

                        • 9. Re: Copy field contents only works if field is on a layout?
                          ojoip

                          Thank You SOOOOOOOOO MUCH! Worked like a charm.. Awesome work.