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

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

Recommended Posts

Posted

I've written a set of scripts and layouts which together produce a "found set" of records. How do I write a script which goes through each of these records and changes a field in each?

Just in case it complicates things, the records in the found set are of two different types. Depending on the type, the field that I want to edit will change.

Posted (edited)

I'm not sure I understand what you mean by two different types? Do you mean Date vs Number vs Text?

Create a List layout to view the found set. Your script would look something like this:

Go To Layout(ListLayout)

Sort Records()

Go to Record/Request(First)

Set Variable($ChangeToData;"Yellow")

Loop

If(FieldtoChange<>$ChangeToData)

Set Field(FieldToChange;$ChangeToData)

Go to Record/Request(Next; Exit after last)

else

Go to Record/Request(Next; Exit after last)

EndIf

EndLoop

*/All my scripts always need a little tweaking, but, this is the general idea.

hth

///It's a good idea to always back up your files before changing lots of data records. Especially in the development stage.

Edited by Guest
Posted

That's great, thank you!

Don't worry about the different "types" of data, I managed to get round that problem. What I was stuck on was how to iterate through a found set.

Posted (edited)

Btw, if you want to check each record to see if a specific field is equal to another rather than hard code the new field data you should add the variable in to the loop.

Go To Layout(ListLayout)

Sort Records()

Go to Record/Request(First)

Set Variable($ChangeToData;LookintoField)

Loop

If(FieldtoChange<>$ChangeToData)

Set Field(FieldToChange;$ChangeToData)

Go to Record/Request(Next; Exit after last)

else

Go to Record/Request(Next; Exit after last)

EndIf

Set Variable($ChangeToData;LookintoField)

EndLoop

Edited by Guest

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