November 26, 200817 yr 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, 200817 yr by Guest 2nd Value
November 26, 200817 yr 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.
November 26, 200817 yr And to add further to DJ's response, when FileMaker duplicates a record, it NEVER duplicates the auto-enter serial ID.
November 26, 200817 yr Author 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
November 26, 200817 yr Not sure what you're trying to accomplish here. If you want the value to duplicate, turn the auto-enter off.
November 26, 200817 yr Author 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?
November 26, 200817 yr 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.
November 28, 200817 yr 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...
November 28, 200817 yr 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, 200817 yr by Guest Changed a few words
November 28, 200817 yr 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, 200817 yr by Guest Added sentence
November 29, 200817 yr Ah ha! Hadn't thought of an approach like that. Very clever, works great. Thanks.
December 2, 200817 yr Author 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?
Create an account or sign in to comment