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.

Make a loop in Filemaker to copy data from one table to another

Featured Replies

  • Newbies

I have the following problem, I don't know how to make this specific script work properly. Sorry if it is in spanish since it was made for spanish speakers in mind

  1. I have four tables, Factura, Detalle_Factura, Presupuesto y Detalle_Presupuesto
  2. The relationship of these tables is like this BcgaJ.png
  3. This is the layout in which I am trying to run the script. The portal below has the data from Detalle_Presupuesto and I need to pass that data from the portal to Detalle_Factura
     E2CQg.png
  4. This is the script I am trying to use but it only copies the first row of the portal row, I tried to do a loop too but it runs forever too x2LgE.png
  5. This is the layout I am trying to feed, the portal below has the data of Detalle_Factura and I need to feed it with the data of Detalle_Presupuesto PvORh.jpg
  6. I do have an empty presentation with the data of Detalle_Factura

In case this doesn't help, I am leaving a temp link with the database itself

Edited by Ocean West
added images inline.

First of all: is there a reason why you cannot import the records from the Detalle_Presupuesto table into the Detalle_Factura table? 

Even before that: do you really need two sets of data? Couldn't you simply flag the record in the parent table as a "factura"?


Now, I can't really follow your script. I think that if you really want to copy the related records in the Detalle_Presupuesto table, one by one, into the Detalle_Factura table, you should start by creating a found set of these records in a layout of the Detalle_Presupuesto table. This is easy to do using the Go to Related Record script step:

Go to Related Record [ Show only related records; From table: “Detalle_Presupuesto”; Using layout: "Detalle_Presupuesto" ]

Then just loop over these records using:

Go to Record/Request/Page [ Next; Exit after last ]

No counter is required for this.

Of course, this assumes you have already created a parent record in the Factura table and stored its unique ID in a variable, so that you can link the records you will create in the Detalle_Factura table to this record.


Finally, this caught my eye: you really don't want to use a random number as the $factura_id - certainly not a number drawn from a population of 500! Use either a serial number or a UUID.

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.