jim0203 Posted March 11, 2009 Posted March 11, 2009 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.
aldipalo Posted March 11, 2009 Posted March 11, 2009 (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 March 11, 2009 by Guest
jim0203 Posted March 11, 2009 Author Posted March 11, 2009 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.
aldipalo Posted March 11, 2009 Posted March 11, 2009 (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 March 11, 2009 by Guest
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now