Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

copy the whole row

Featured Replies

Hi,

I've 5 fields(repeating fields,column) in my db.

The problem I've is I can't copy all the fields at one go.(I want to copy the whole row at one go)

Currenty I need to go to every fields to copy one by one to another file.

I've written script to copy but the script only works for the first record.

Repeating? You mean that those fields should keep the same data through the comple database? Well you can set auto-enter from Previous record or special data, just using the Options choice in the Define Fields dialog. wink.gif

  • Author

Thanks for your reply.

But what I want is:

Item(field) Description(field) Price(field)

(R1) 1 Candy 3.00

(R2) 2 Chocolate 5.00

I want to select the whole of row one(R1) to another FM aplication.

It's a bit tedious, but it can be done.

To copy a whole row to a corresponding destination row, you'll need a script which transfers each value in turn. To do this, first create a global text field called "gTemp.txt" (assuming your repeating fields are text fields). Then create a script along the lines of:

Set Field ["gTemp.txt", "GetRepetition(ItemField, 2)"]

Set Field ["YourRelatedDb::RelatedItem"-2, "gTemp.txt"]

Set Field ["gTemp.txt", "GetRepetition(DescriptionField, 2)"]

Set Field ["YourRelatedDb::RelatedDescription"-2, "gTemp.txt"]

Set Field ["gTemp.txt", "GetRepetition(PriceField, 2)"]

Set Field ["YourRelatedDb::RelatedPrice"-2, "gTemp.txt"]

Set Field ["gTemp.txt", ""]


There's no escaping the fact that you'll need a number of scripts along the lines of the above, so it isn't a highly flexible solution, but it may be better than the manual alternative.

A much better and more flexible approach would be to dispense with the repeating fields and use portals listing related records from a sub-file instead.

Further to my previous post, the inimitable 'Dj' has (on a thread elsewhere) suggested a more streamlined 'work-around' for the problem, and I thought it might be useful to you if I posted it here.

(incidentally, the 'reason' for the difficulty which led me to suggest a two-step copy procedure for each value is discussed on the FMI knowledge Bnase article no 104269 if anyone is interested in the background) crazy.gif

The more streamlined 'fix' is to include & "" after the GetRepetition function. Don't ask me why, but I tested it and it seems to work. Thus the seven steps of the script I suggested in the previous post could be compacted down to:

Set Field ["YourRelatedDb::RelatedItem"-2", "GetRepetition(ItemField, 2) & "" "]

Set Field ["YourRelatedDb::RelatedItem"-2, "GetRepetition(DescriptionField, 2) & "" "]

Set Field ["YourRelatedDb::RelatedDescription"-2, "GetRepetition(PriceField, 2) & "" "]


Which I'd have to say is tidier than the foregoing option (not to mention the fact that no global field is required...). wink.gif

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.