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.

Duplicate Record Portals Q

Featured Replies

I want to put a button on my Purchase order form to create a duplicate record. My form is related to another file for line items, which I input through a portal. The problem is when I duplicate a record none of the portal items show up. Is it possible for FM to duplicate the contents of a portal too, or do I have to avoid using the portals?

You need to duplicate both the master record and the related line items records ...

Perfectly doable, a bit convolute ... the script would look like:

Set field (gID, OrderID)

//Note: this is the "original" OrderID, OrderID is a unique serial number,gID is a global field

Duplicate master record

Go to related record (Show, Relationship to line items linking gID::OrderID)

//This selects the line items belonging to the "original" OrderID

Set field (gID, OrderID)

//Note: this is the "duplicate" OrderID

Perform external script in Line Items, see below

Go to record [Last]

Loop

Duplicate record

Set field (OrderID, Relationship to Orders::gID)

//This steps puts the "duplicate" OrderID in the duplicate line item record

Omit Record

Omit Record

Exit Loop If (Status Current Found Count < 1)

End Loop

  • Author

Hey thanks for the help. A little daunting seeing as I've never actually done a script, but I tried it out. I think I got it except I got hung up on one action:

Exit Loop If (Status Current Found Count < 1)

FM would not allow me to type it this way "not recognized as a flag" or something like that. Maybe I should read a book.

Sorry, the sintax was approximate ....

the correct one is:

Status (CurrentFoundCount)<1

  • Author

Thanks again. It almost worked this time. It copied everything 3 times. I guess I'm having a problem with relationships (with my database that is). Right now I have a relationship between PO.fp5 (the master file) and line items.fp5 (related file) with the two joined on a field called PO Number (Auto-serial). Do I have to create some more relationships to the new global field created in PO.fp5?

You've just to make a new relationship between the global field and the PONumber in LineItems ... check the script in LineItems and see if you're omitting both the original record and its duplicate ...

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.