March 11, 200916 yr 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.
March 11, 200916 yr 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, 200916 yr by Guest
March 11, 200916 yr Author 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.
March 11, 200916 yr 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, 200916 yr by Guest
Create an account or sign in to comment