tmas73 Posted November 26, 2008 Posted November 26, 2008 (edited) When i duplicate a record it will not duplicate a field with a Menu Popup. Is there a way it copies all fields? I failed to mention one of the Popup Menue Fields is a second field value, the first field is a Serial number. T Edited November 26, 2008 by Guest 2nd Value
David Jondreau Posted November 26, 2008 Posted November 26, 2008 When a field isn't duplicating (assuming you're duplicating via the default FM menu commands and not a script), it's usually because there's an auto-enter option checked in that field's definition.
LaRetta Posted November 26, 2008 Posted November 26, 2008 And to add further to DJ's response, when FileMaker duplicates a record, it NEVER duplicates the auto-enter serial ID.
tmas73 Posted November 26, 2008 Author Posted November 26, 2008 Ahh good to know, thanks. So would there be a way to have a auto enter and duplicate by script? If so do you have a example? Thanks
David Jondreau Posted November 26, 2008 Posted November 26, 2008 Not sure what you're trying to accomplish here. If you want the value to duplicate, turn the auto-enter off.
tmas73 Posted November 26, 2008 Author Posted November 26, 2008 To be more flexible. My auto enter calculation is: TextFormatRemove (prod_supply_link) for example. I use this calc in a lot of fields specially fields where people copy and paste from websites. So this function would be lost if I deactivate the auto enter. So you say ether-or in this case?
David Jondreau Posted November 26, 2008 Posted November 26, 2008 No, it's more complicated than either/or. Is the field with the auto enter, the prod_supply_link field? If so, the auto-enter calc shouldn't prevent a duplicate from happening. We don't have enough details to diagnose what's going on. What is a "second field value"? What fields aren't duplicating? What are they set to? An example file would be best.
tmas73 Posted November 27, 2008 Author Posted November 27, 2008 Thanks I will get back (with file) after the holidays!
tinynumbers Posted November 28, 2008 Posted November 28, 2008 From the FM docs for Duplicate Record/Request script step If the record has a field set up for automatic entry of values, Duplicate Record does not duplicate the value in the field of the current record. In that case, FileMaker Pro generates and enters a new value for the duplicated record. I'm wondering what may be the same thing as tmas73: is there any way to do a "Duplicate Record" which DOES duplicate the auto-enter data (with the exception of unique serial numbers)? I have some of the fields of my table setup with auto-enter data just to define starting point default values when a user creates a new record. But if I'm doing a "duplicate record", I want to duplicate the user-entered values, not reset the values on the new record to those default auto-enter values. Is there any way to do this that doesn't involve a manual "Set Field" script step for each and every one of those fields? I hope so, I wouldn't want to have to edit this "Duplicate" script each time I make a change to my table definition...
LaRetta Posted November 28, 2008 Posted November 28, 2008 (edited) You can. But you need to change your Auto-Enter by including a global number flag (1 being override). This global can be in any table and does not have to relate to any of the tables where you use it. Create a value list with custom value of 1. If you name this value list 'select' then it can be used for hundreds of things. Create a global number. When checked, this will mean 'override default auto-enter.' Then change your auto-enters to calculations and it would look like (assuming it is on a Type field which would prefill with word Customer but, if checkbox is checked, will instead duplicate the * previous record: Case ( globals::gOverrideAutoEnter ; GetNthRecord ( Type ; Get ( RecordNumber ) - 1 ) ; "Customer" ) This global checkbox can be placed on any layout from any table occurrence and is user-specific. * previous record can be deceptive, ie, it will be the last record the User was accessing and not last in a list. And if the user just opens the database, there will be NO previous record. Edited November 28, 2008 by Guest Changed a few words
LaRetta Posted November 28, 2008 Posted November 28, 2008 (edited) Oh! I forgot to mention that, within the calc box at the bottom, be sure 'Do not evaluate if all refererenced fields are empty' is unchecked. Otherwise it won't fill with your default value. Also your duplication should be scripted with: Duplicate Record/Request Commit Records/Requests If you do not commit the record before you set the global to override and then duplicate, your User could still be on the 'previous' record and it won't recognize it. If you play with it, I think you'll see what I mean. And you will need to control New Record Requests as well and make sure that global field is blank before running New Record scripts. Edited November 28, 2008 by Guest Added sentence
tinynumbers Posted November 29, 2008 Posted November 29, 2008 Ah ha! Hadn't thought of an approach like that. Very clever, works great. Thanks.
tmas73 Posted December 2, 2008 Author Posted December 2, 2008 You can. But you need to change your Auto-Enter by including a global number flag (1 being override). This global can be in any table and does not have to relate to any of the tables where you use it. Create a value list with custom value of 1. If you name this value list 'select' then it can be used for hundreds of things. Create a global number. When checked, this will mean 'override default auto-enter.' Then change your auto-enters to calculations and it would look like (assuming it is on a Type field which would prefill with word Customer but, if checkbox is checked, will instead duplicate the * previous record: Case ( globals::gOverrideAutoEnter ; GetNthRecord ( Type ; Get ( RecordNumber ) - 1 ) ; "Customer" ) This global checkbox can be placed on any layout from any table occurrence and is user-specific. * previous record can be deceptive, ie, it will be the last record the User was accessing and not last in a list. And if the user just opens the database, there will be NO previous record. Interesting approach. I do wonder though, * previous record can be deceptive.... cant it be the current record and duplicate the current record that is browsed as we see it?
Recommended Posts
This topic is 5836 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