mdurg Posted February 24, 2004 Posted February 24, 2004 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
Steve T. Posted February 24, 2004 Posted February 24, 2004 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
Justin Grewe Posted February 24, 2004 Posted February 24, 2004 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
Garry Claridge Posted February 24, 2004 Posted February 24, 2004 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
mdurg Posted February 24, 2004 Author Posted February 24, 2004 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
mdurg Posted February 24, 2004 Author Posted February 24, 2004 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
Jeff Spall Posted February 24, 2004 Posted February 24, 2004 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
mdurg Posted February 24, 2004 Author Posted February 24, 2004 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
Steve T. Posted February 28, 2004 Posted February 28, 2004 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
Recommended Posts
This topic is 7644 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now