Jump 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 or Duplicate multiple records per customer

Featured Replies

Assignment: to copy 'work order' records per customer to save the customer time.

 

I have two related tables . The customer table has customer details. The other table has all the  'work orders'.

I have pulled in the 'work orders' into the customer as a portal.

I have created a button to duplicate one record.

See attached script.

QUESTION: how to copy all records per customer.

I have workorderID / customernumber id.

 

copy one record.JPG

35 minutes ago, Sharifa said:

I have two related tables .

Are you sure about that? Looking at your script, I would think there are actually three tables involved in this: Customers, WorkOrders and a child table of WorkOrders (WorkOrderItems?). Otherwise I don't understand what the Loop section of your script does.

Anyway, if you have a script that works for one record, you can run it in a loop for a group of records - same as you do for the records in the child table. Note that in both cases you can use the Go to Related Record script step instead of a find.

 

44 minutes ago, Sharifa said:

copy 'work order' records per customer to save the customer time.

I am not sure how exactly this is supposed to "save time". I can understand that sometimes it is convenient to duplicate a previous work order instead of creating a similar one from scratch - but I cannot see the purpose of duplicating all of them.

 

  • Author

The background if it helps.

It's a test assignment. So figuring it out myself.

It is a garden service company. A customer such as a hotel places many orders.

For example, a customer has 10 orders. 

They need to copy these 10 orders with click of the button.

see attached.

 

button for copy all records.JPG

When I do this manoeuvre I do a find for the desired records, I then export as Get(TemporaryPath)/ordersAsTemplate.<<timestamp>>.FMPXMLRESULT.xml, and import this exported file to the same table, remember after this has been imported the data you just imported will be a selection and you can do replace on this if you need to prepare some data for the new template. Make sure you do an if for found set prior to export to avoid exporting all records in the table.

There is no shame in making a separate layout for the purpose of this export and import.

You may ask why I do XML export opposed to FileMaker Pro file type; the answer is file size, while still keeping the structure.

Edited by ggt667

Create an account or sign in to comment

Important Information

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

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.