Newbies sjhendee Posted September 21, 2000 Newbies Posted September 21, 2000 Can anyone troubleshoot this Script? I want to merge all the rows of portals into one field, ending automatically when I get to the last row. I can't seem to figure out how to get out of the loop. Script Go to Record/Request/Page [first] Loop Go to Portal Row [first] Set Field [field 1:file B] Loop Copy [select entire contents] Go to Field [field merged:file A] Paste Go to Portal Row [next, exit after last] End Loop Go to Record/Request/Page [next, exit after last] End Loop Thanks in advance. Steve
Kurt Knippel Posted September 21, 2000 Posted September 21, 2000 quote: Originally posted by sjhendee: Can anyone troubleshoot this Script? I want to merge all the rows of portals into one field, ending automatically when I get to the last row. I can't seem to figure out how to get out of the loop. I will not try to troubleshoot the script, but offer what is probably a better solution. Keep the outer loop, which goes through the records in your main file. Use the "Goto Record [Next, Exit After Last]" step to get out of the loop at the end. Within the loop use a "Go To Related Record [PortalRelationship, Show Only Related Records]" step to goto the second file and get a set of only the related records (i.e. those that are in the portal). Then use the "Perform Script [External, External Script]" to run another looping script in your sub-file. This loop will simply build all of your related data into a single global field. Then use the "Set Field [RelationshipToMainFile::MergedField = GlobalMergeField]" to put the merged data back into the record in the main file. This scenario seems more complicated on the surface, but will be much easier to work with in the long run and solves your problem very well. ------------------ =-=-=-=-=-=-=-=-=-=-=-=-= Kurt Knippel Consultant Database Resources mailto:[email protected] http://www.database-resources.com =-=-=-=-=-=-=-=-=-=-=-=-=
Newbies sjhendee Posted September 23, 2000 Author Newbies Posted September 23, 2000 Thanks for the reply. Most of the script is now working, it is more complicated but functions alot better than my way. I am having difficulty though getting the "Merged" field to match the "Global Merged" field. The Merged field is leaving out the last record that shows in the "Global Merged" field when I pause the script. Any help is appreciated. Steve
Kurt Knippel Posted September 24, 2000 Posted September 24, 2000 quote: Originally posted by sjhendee: Thanks for the reply. Most of the script is now working, it is more complicated but functions alot better than my way. I am having difficulty though getting the "Merged" field to match the "Global Merged" field. The Merged field is leaving out the last record that shows in the "Global Merged" field when I pause the script. Sorry, my example was poorly structured. Assuming that you have a relationship to the main file by MainRecordID or something. SetField [Mainfile by MainRecordID::MergedPortal Data, GlobalMergedData] So basically you are setting the MergedPortalData field in the main record equal to the GlobalMergedData field that you filled in the secondary file. The relationship is the normal Child-Parent relationship that is the same as the Parent-Child relationship from the Mainfile. You dfo not use the merged data in building the realtionships. ------------------ =-=-=-=-=-=-=-=-=-=-=-=-= Kurt Knippel Consultant Database Resources mailto:[email protected] http://www.database-resources.com =-=-=-=-=-=-=-=-=-=-=-=-=
Newbies sjhendee Posted September 26, 2000 Author Newbies Posted September 26, 2000 Thanks, it worked. I appreciate your help. Steve
Recommended Posts
This topic is 8810 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