Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Duplicate Record and Value!


This topic is 5836 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (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 by Guest
2nd Value
Posted

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

Posted

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?

Posted

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.

Posted

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...

Posted (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 by Guest
Changed a few words
Posted (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 by Guest
Added sentence
Posted

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?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.