Chuck Posted June 13, 2001 Share Posted June 13, 2001 This one has come up a couple of times in the last couple of weeks, so I figured it deserved a FAQ entry. The question is, given a database with a portal into a related file, how can you duplicate a record in the parent file and bring the data over from the portal. Simply duplicating the record doesn't do the trick. The only thing you need to add to your system is a global field in the child file which I'll call gNew_Parent_ID. In my example scripts below, Parent_ID is a field in both files that the relationship is based on and Child is the name of the relationship in the Parent file. In the child file, create the following script: Unsort Go to Record/Request/Page [ First ] Loop Link to comment Share on other sites More sharing options...
Moon Posted June 13, 2001 Share Posted June 13, 2001 Great technique, and a superb explanation. Bravo, Chuck! Link to comment Share on other sites More sharing options...
Lee J Posted June 26, 2001 Share Posted June 26, 2001 Thumbs up for your excellent article re Portal Duplication. Keep up the good work. Link to comment Share on other sites More sharing options...
Kay Posted August 31, 2001 Share Posted August 31, 2001 Thank you. Thank you. Thank you. You saved me hours of work. Your cheque is in the mail! Kay. Link to comment Share on other sites More sharing options...
nati Posted October 7, 2001 Share Posted October 7, 2001 Hi Chuck, Was just reading through the posts and came across this. Very clever. I've done it with two global fields (g_new_parent_ID one and two) but I like this better. Well done! nati Link to comment Share on other sites More sharing options...
falkaholic Posted February 6, 2002 Share Posted February 6, 2002 If there was a nobel prize for FileMaker. I'd nominate you! Link to comment Share on other sites More sharing options...
joseppic Posted August 7, 2003 Share Posted August 7, 2003 Any advice as to how I use this to duplicate Children and Grandchildren in a similar simple fashion? Do I just call an external script from within the loop through Children? Is this possible? Thanks. Link to comment Share on other sites More sharing options...
ernst Posted August 12, 2003 Share Posted August 12, 2003 Hey Chuck, Today I used (stole) your technique. Worked great! Thanks, Ernst. Link to comment Share on other sites More sharing options...
laker_42 Posted August 21, 2003 Share Posted August 21, 2003 Ok, I used the script that Chuck wrote and it works great. The parent file that I want to drive this from has 3 portals to 3 separate files. Is there a way to do this for all 3 portals at the same time? What happens if I try to go to a related record that isn't there? Not all records will have related records in all 3 portals. Can I just combine all 3 scripts in the parent file to one script? I have a feeling it is going to hang the script when it tries to go to a related record that is not their. Any additional input? Thanks! John Link to comment Share on other sites More sharing options...
ernst Posted August 21, 2003 Share Posted August 21, 2003 You could check if child records are present by changing the child script like: If status(CurrentFoundCount) > 0 : [original script] End If Regards, Ernst. Link to comment Share on other sites More sharing options...
laker_42 Posted August 25, 2003 Share Posted August 25, 2003 Thank Ernst! That did it. John Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 7550 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