Jump to content

Script not working after converting from v5 to v7


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

Recommended Posts

  • Newbies

I have read some of the posts stating that copy/paste is not the way to go, however, can anyone explain why the following script has worked every week for the last 5 years in v5 and now won't work in v7?

The following script copies info from one portal and pastes it into another:

Go to Portal Row[select;First]

Loop

Copy [select;Field to copy from]

Paste [select;Field to paste to]

(THE ABOVE COPY PASTE IS PERFORMED TWO MORE TIMES (FOR TWO OTHER FIELDS)

Go to Portal Row[select;Next;Exit after last]

End Loop

Go to Portal Row [select;Field to go to]

As noted, this script used to work without problems everytime. What happens now is that only the first portal row in the first record pastes and then it gets hung up. Also, the only difference (which seems to be unchangeable) is that the last step before the loop ends is shown in a different order in v5. V5 reads Go to Portal Row [select;Exit after last;Next]. Is this a problem?

If Set Field is the only way to go, please provide some help, as the small amount of time that I've spent working with it has produced no results.

Thanks

Link to comment
Share on other sites

Karen1:

Welcome to the Forums.

There are a few things which might be going on here. First, make sure that all the fields involved are still editable in Browse mode, and that they are actually in the layout currently being viewed. If they are, the script ought to work and may have become corrupt somehow in the migration process. In that case, you should probably just rewrite the script from scratch and see if that doesn't solve the problem.

If you do rewrite it, you should certainly use Set Field [] instead of copy/paste, as the latter method overwrites the clipboard, and in the case of a failed copy, will paste whatever is currently in the clipboard. It's a very simple method (the parameters are the field to set, and the field to take the value from), and has the added benefit of being able to modify fields which are not in the current layout, and which are not set as editable.

-Stanley

Link to comment
Share on other sites

Even better, use the "Go to Related Record" script step to "find" the related records in the related table, then Loop through the records to Set the fields, rather than moving through portal rows.

Looping through records is very robust and reliable; moving through portal rows is always a bit flakey, especially if there is more than one portal on the layout.

Link to comment
Share on other sites

Vaughan is, as always, correct. I hadn't noticed the bit about the portal, and going to the related records is the way to go.

-Stanley

Link to comment
Share on other sites

  • 3 weeks later...
  • Newbies

I have tried using the Set Field script step. The problem that I am now having is that the script says to look at every portal row in a related table and make certain fields equal what the info is in the portal (set field). What I don't know how to do is to make it create a new record for every portal row (it looks at every portal row but copies the info over and over into one record in the related table). How do I get it to create a new record in a related table for every portal row in another table?

Thanks

Link to comment
Share on other sites

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