Jump to content

Parent Duplication from Child


nightdesigns
 Share

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

Recommended Posts

If a certain value occurs in the child record, I need the parent of it do be duplicated, and a few fields changed. Unfortunatly I can't get over to the parent file to do this via a script. Right now i'm having to set a field that is accessible by both, and then search for it in the parent file and update. Is there an easier way?

Thanks

-j

Link to comment
Share on other sites

quote:

Originally posted by nightdesigns:

If a certain value occurs in the child record,

What do you mean by occurs? Entered by a user? Calculated? Automatically entered?

quote:

I need the parent of it do be duplicated, and a few fields changed. Unfortunatly I can't get over to the parent file to do this via a script.

Why can't you use a script?

Should the child record be attached to the new parent record?

Link to comment
Share on other sites

Assuming there is more than one child record per parent record (otherwise, why use a relationship?), changing the parent based on info in a child record is not a good idea. What happens if different children have values that cause the parent to change in different ways? You're screwed!

Now, if you're duplicating the "parent" record (in other words, creating a new parent for this particular child), that's OK. Assuming you're in the "child" file, create a "reverse relationship" and use that either to get to the correct parent record, or to create a new parent record.

The thing here is that you'll end up with mixed many-to-many relationships, which isn't necessarily a bad thing as long as you understand that this is what you're doing.

Unless, of course, you're changing the key field for the child record in question, which can lead to a whole new can of worms.

********************

Suggestion: Rethink exactly what you where you want to go, then figure out the route.

Link to comment
Share on other sites

quote:

Originally posted by danjacoby:

Assuming there is more than one child record per parent record (otherwise, why use a relationship?), changing the parent based on info in a child record is not a good idea. What happens if different children have values that cause the parent to change in different ways? You're screwed!

Now, if you're duplicating the "parent" record (in other words, creating a new parent for this particular child), that's OK. Assuming you're in the "child" file, create a "reverse relationship" and use that either to get to the correct parent record, or to create a new parent record.

The thing here is that you'll end up with mixed many-to-many relationships, which isn't necessarily a bad thing as long as you understand that this is what you're doing.

Unless, of course, you're changing the key field for the child record in question, which can lead to a whole new can of worms.

********************

Suggestion: Rethink exactly what you where you want to go, then figure out the route.

You're heading in the right direction of what i'm trying to do. I have many children assigned to a single parent. Each child is really an e-mail. And if an e-mail says simply "I didn't sell," then to set the parent as the transaction is complete. But i want to start a new parent with some of the same info as the old one (title, description, etc, but new ID number and no children. So the parent is duplicated, the ID number is tossed for the time being until a new one is assigned, and it doesn't have any children. If you can make sense of all this. Thanks.

Link to comment
Share on other sites

Based on your revised description, this should be no problem. Just GTRR (go to related record) from the child to the parent. Now duplicate the parent. If the key field is an auto-entered serial number, you'll be left with a duplicate of the parent, but with no children, just as you wanted. In any case, you can just have a script in the parent file that sets certain fields as needed. So you would have your script in the child file first GTRR, then perform external script (the one in the parent file).

Link to comment
Share on other sites

quote:

Originally posted by Fitch:

Based on your revised description, this should be no problem. Just GTRR (go to related record) from the child to the parent. Now duplicate the parent. If the key field is an auto-entered serial number, you'll be left with a duplicate of the parent, but with no children, just as you wanted. In any case, you can just have a script in the parent file that sets certain fields as needed. So you would have your script in the child file first GTRR, then perform external script (the one in the parent file).

Unfortunatly I have something like that (show related, run this script externally (from the parent file for the parent file)), but it doesn't work. FM doesn't seem to want to go to a related record while executing a script. Am i doing something wrong?

Thanks

-j

Link to comment
Share on other sites

This topic is 7140 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
 Share

×
×
  • Create New...

Important Information

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