Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

I know how to set the value of one field to another field, the trouble I'm having is making the script run through all the records and set the value of one field to another field.

Here's what I have for the script:

Go to Layout ("Layout 1")

Show All Records

If [Field 1="A"]

Set Field ["Field 2", "A"]

End If

What's the proper way to make it run through all the records and set the values of Field 1 to Field 2? Would a Loop Statement work? Not exactly sure how to setup the syntax.

Please help!!

Thanks

Ron

Posted

Show All

Go to Record(first)

Loop

If....

Set Field...

Go To record(next, exit after last)

End If

End Loop

** edit: do yourself a favor and make a backup copy of the file before running scripts that change a large number of records... just in case.

Posted

Just off the top of my head:

How about the replace spript step for field 2, using the calculation Case(field1="A"; "A"; field2). This will probably be much faster then a loop. Thus if the field2 will be populated with A if field 1 is A, but left to its original value (field2) if the condition is not met. Good luck.

PS I wish the Fm designers used additional words in the terms for the script and functions "replace" and "substitute". It would create less confusion.

Posted

SBG2 - Thanks so much for the loop script, I tried it and it worked, but then I tried the Replace & CASE from Old Sneakers and that was a lot quicker.

Thanks to both of you for solving it...this will make things a lot easier!

P.S. I did make a backup copy to test this on. Thanks for the tip.

Posted

A few things to note ...

In vs. 6, Replace Contents requires the field be on a layout before it will work. It also will not provide an error message if the record is currently locked by a User in networked environment, so if this is a networked solution I'd use the Set Field instead.

Curious that, in vs. 7, is still indicates the field must be on the layout but tests prove otherwise.

LaRetta

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