Jump to content

duplicate current record and it's related record.


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

Recommended Posts

Hi

I'm trying to create a script that will allow to duplicate a record and it's related records.

The problem that I am facing is that when I duplicate the parent record, I need a way to get the related records of the original parent record.

The way I was going to go about it is,

Duplicate the parent record

Store the new duplicated record id into a global (not sure if this is the best way, might be 6 thinking)

Go to the related record of the original parent record.

Loop through and duplicate the related records and assign the parent id with the value stored in the global.

The problem is, when I duplicate the original parent record, I am at the duplicate record and I can't figure out how to go back to the original so I can get the related records.

Thanks for any suggestions and any insight on a 7 like approach to this.

Link to comment
Share on other sites

you almost have it -

you should actually keep the original record in the global field. then go back to that original record after duplicating it (either by finding the record via the global or a relationship) and continue

( go to related records and duplicate and update the new "key" with the global.

good luck

Link to comment
Share on other sites

When I store the original id (a auto-enter serial number) in a global field and go to related record, it doesn't go to it. It just stays at the newly created record.

Here is again is what I do:

I set the original parent ID to global field.

then duplicate the original record.

then Go To Related Record of the current table and current layout and it never goes to it.

The relationship is a global = to the id.

I'm having a hard time understanding this Go To Related Record in FM 7.

Thanks.

Link to comment
Share on other sites

This topic is 7239 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.