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.

Duplicate -> go to a different format

Featured Replies

Hi,

I have a standard "record_detail" format with "submit" and "duplicate" buttons at the bottom. Hitting either button makes the appropriate changes to the database and calls the "record_detail_reply" format for to alert user.

Is there a way to make the duplicate button instead call the "record_detail" format with the duplicated record opened? My users would like to be able to edit the new record immediately after hitting the duplicate button. Maybe set the button to perform an inline action?

Just looking for a little guidance on how to do this.

Thanks,

Mark Durgee

Hi, Mark! I'm not sure I understand exactly but this is Custom Web Publishing, right? You should be able to just indicate your edit page as your -format page for the -dup action instead of the detail page.

<INPUT TYPE="hidden" NAME="-format" VALUE="myeditpage.html">

instead of

<INPUT TYPE="hidden" NAME="-format" VALUE="mydetailpage.html">

If you don't have an edit page yet, you can easily make one from your detail page. Just change your [FMP-field:nameoffield] tags to the appropriate text box, radio button, check box, etc. and put your [FMP-field:nameoffield] tags as the defaults (initial settings) for those form objects. Make sure the name of the object matches the corresponding FileMaker field exactly and make sure you have the

<INPUT TYPE="hidden" NAME="-recID" VALUE="[FMP-CurrentRecID]">

line in there. Please correct me if I misunderstood your question but I hope this helps some. --ST

mdurg,

I guess i'm with Steve on this when I don't totally understand the question. You are ariving at the page which has the two buttons at the bottom with a page that lets the user choose which record they want to view, right? Then once they are in that record they have options, namely, they can duplicate the record. After they duplicate that record they want to edit that duplicate? Are you sure you need a duplicate? Why not just edit the original?

I believe the action for duplicate record is -dup like Steve said so then the submit tag would become:

<input type="submit" name="-dup" value="duplicate record then edit"/>

Justin Grewe

You can use some Javascript to change the Format file, depending on the button clicked.

document.myform.elements['-format'].value = xxxxxx;

All the best.

Garry

  • Author

Thanks everyone for your replies. Steve and Justin, let me clarify...

I'm in the edit record page which contains two buttons - Submit and Duplicate. The format page is a "reply" page which basically tells the user of success or failure. What I wanted to do was to change the format page for the Duplicate button only. This would allow the user to immediately make some changes to the now new record.

Garry, that's what exactly what I'm looking for. I have not seen that anywhere. Everything I've found so far pretty much says that there can only be 1 format page.

Thanks,

Mark Durgee

  • Author

Not knowing a whole lot about Javascript, would I be going i nthe right direction doing something like this:

<INPUT TYPE="submit" NAME="-Dup" VALUE="Duplicate this record" onClick="document.myform.elements['-format'].value = myformat.htm">

Thanks,

Mark Durgee

Hi, just a thought, from either the "edit" or "duplicate" action, your format page could be:

<HTML>

<HEAD>

</HEAD>

<BODY>

[FMP-IF: CurrentAction.eq.dup]

[FMP-INCLUDE: dupe_format.txt]

[FMP-ELSE]

[FMP-INCLUDE: edit_format.txt]

[/FMP-IF]

</BODY>

</HTML>

"edit_format.txt" and "dupe_format.txt" contain all the html and CDML for the formats you want and they would be populated with the current record - the original or the duplicate depending on the action.

regards, jeff

  • Author

Jeff,

Thanks for your reply. That's what I was thinking of doing originally (using FMP-IF) but since my format page was a simple status update to the user (e.g. "The record has been submitted") it didn't seem like it would do what I wanted. But by using an FMP-INCLUDE, it is very much like having the ability to use multiple formats.

Thanks again,

Mark Durgee

Hi, Mark! What if you used two forms on the page? The SUBMIT would submit the edit as usual, but you make a tiny new form just for the DUP button? On a project I'm currently working on and off, I have a table with a button in each cell and each one is a separate form. I could be wrong, but you should be able to do...

EDITFORM

(SUBMIT)

-------------------------

DUPFORM

(DUPLICATE)

--ST

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.