November 22, 201015 yr I would like to be able to create multiple new related records (letters) based upon a found set in (dwellings) using key field (license #.) I know how to do this one at a time with scripting (create new record and copy/paste the key field) - can this be done with many records at a time? Not sure how to get the right number of records created, and how to insert the key fields.... Any help - MUCH appreciated!
November 22, 201015 yr Author As in... export the found set, create new records, import the found set data?
November 22, 201015 yr No, as in create a found set in the source table (dwellings?), go to a layout of the target table (letters?) and import directly from the source table.
November 22, 201015 yr Copy/paste should pretty much always be avoided. There are several ways to gather a list into a variable and then process the list. Set variable [ $list; "A¶B¶C¶D"] Set variable [ $n; valueCount( $list}] Set variable [$k; 1] Loop Exit loop if ($k > $n) New record Set somefield; getValue( $list; $k) Set variable [ $k; $k + 1] End loop
November 22, 201015 yr Author Ok - I think I see how the variable and loop works. I'm not quite following the first portion of this script: Set variable [ $list; "A¶B¶C¶D"] Do I have to establish a repitition number for the variable? (this will vary, and could be in the 200-300 range at times) {EDIT: it looks to me like Get(FoundCount) would work here - am I on the right track??} {EDIT#2: so found count can get me the number of items in the found list. The loop can then create a new record, and set the key field to the next value in the list... How do I get the individual license numbers into my variable "list"? Edited November 22, 201015 yr by Guest still learning!
November 23, 201015 yr No, you do not need to use a repetition number. The example variable just shows how a variable can contain a list. You will have to use a loop to walk the records and collect the list of values. Set variable [ $list; "" ] Go to record [ first ] Loop Set variable [ $list; list ( $list; your::field) ] Go to next record, exit after last End loop
November 23, 201015 yr Author No, you do not need to use a repetition number. The example variable just shows how a variable can contain a list. You will have to use a loop to walk the records and collect the list of values. Set variable [ $list; "" ] Go to record [ first ] Loop Set variable [ $list; list ( $list; your::field) ] Go to next record, exit after last End loop Thanks - this makes more sense, especially after studying the LIST function and realizing it does not work across a found set, but on a record and related records. Regarding the loop above - can I really use "exit after last record" - or was this more of a shorthand way of saying write the script to advance one and compare, then leave when k>n?:( Edited November 23, 201015 yr by Guest clarification
November 23, 201015 yr Author Disregard - found the Next(exit after last) script step! Thanks - this makes more sense, especially after studying the LIST function and realizing it does not work across a found set, but on a record and related records. Regarding the loop above - can I really use "exit after last record" - or was this more of a shorthand way of saying write the script to advance one and compare, then leave when k>n?
Create an account or sign in to comment