1 Reply Latest reply on Jul 21, 2010 2:05 PM by philmodjunk

    Copying and Pasting content of Multiple fields!

    camposr

      Title

      Copying and Pasting content of Multiple fields!

      Post

      FM Pro 11

      OSX 10.6

      Hello!

      I have 2 quick questions!! 

      1) Can I have the selected record highlighted in Table View?

      2) Is there a way i could copy the contents of multiple fields from record A and paste them into the corresponding     fields in record B?

      Thanks for you time!

      Ricardo

        • 1. Re: Copying and Pasting content of Multiple fields!
          philmodjunk

          1) Yes, you can use a script trigger for this.

          1. Define a global number field ( a global variable could also be used), gCurrentRecord
          2. Write a script with just one line: Set Field [YourTable::gCurrentRecord ; get ( RecordID ) ]
          3. In Layout Setup... specify a layout script trigger, OnRecordLoad to perform this script
          4. Select all your fields that make up the row and apply this conditional format expression:  Formula Is:  Get ( RecordID ) = YourTable::gCurrentRecord
          5. Specify a fill color and you are done.

          Note: In list or form view, you can place a single empty field behind all the layout objects and apply this conditional format to just this one field to highlight the record.

          2) Yes there is, but if you need to copy the contents of multiple fields from one record to another, you likely do not have the best design for your database. Establishing a related table to which you link both record A and record B and storing the data in the related record is often a much better approach. In other cases, auto-enter settings that copy the data from a related table are a better choice.

          If you insist on copying the data, a script like this will work:

          Set Variable [$Field1; Value: YourTable::Field1]
          Set Variable [$Field2; Value: YourTable::Field2]
          Go To Record [//specify a change that takes you to Record B, you might need to perform a find instead, depending on your situation.
          Set Field [YourTable::Field1 ; $Field1]
          Set FIeld [YourTable::Field2 ; $Field2]