Jump to content
The site is updated on a beta version. Maintenance tasks are running so search and index may not function at this time. ×

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

Recommended Posts

I have another file showing the related records of the "constellation_join" file. Say I get 3 matches. The script in the "constellation_join" file is supposed to loop through all the results, make a duplicate of each record and change two fields on each record. The script is as follows:

Goto Record/Request/Page [First]


Duplicate Record/Request

Set Field ["Ongoing CY ID", """"]

Set Field ["CPS Investigation ID", "relationship::CPS Investigation ID"]

Goto Record/Request/Page [Exit after last, Next]

End Loop

What is happening is it only goes to the first record, duplicates it, and then exits the loop. I've put pauses in, and it does list all the records in the found set (i.e. 3 out of 170), it just seems to quit after it's done with the first record.

I've done loops before, and I can't find any differences loop-wise that would be causing it to do what it's doing. I'm sure it's something completely simple, but it's driving me crazy.

Link to post
Share on other sites

If you don't have the records uniquely sorted, then the duplicate will appear at the bottom of the found set. Then when you Go to Record/Request/Page [Exit after last, Next], you have passed the end and the loop is complete.

Try sorting the records by a unique field that will be the same in the duplicate. I usually renumber a sort field from 1 to X, and use that. Then your duplicate will appear directly underneath the current record, and Go to Record/Request/Page [Exit after last, Next] will work as desired.

Link to post
Share on other sites

Duplicate can work 2 different ways. If the records are Unsorted it will put the duplicate at the end, which is what's happening. Hence it exits prematurely. If however you Sort the records (can be by anything, even a Constant=1, which doesn't appear to do anything), then the duplicate will be put immediately after, and it stays sorted, so you can Loop. That's what you'd want.

Link to post
Share on other sites

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

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