April 23, 201213 yr Hi, I have a table, which i have a field named "clientnames" i would like to copy its contents into another table. By using setfield, it only copies the first value. i have tried using an id in another field. using setfield with if function but it returns same result. i know i have to loop it somewhere but i really have no clue now because i can't seem to specific a value using an id to update into the new table. please shed some light on this. thanks regards
April 23, 201213 yr Could you provide a more detailed description of what you have to start with, and what are you trying to accomplish?
April 23, 201213 yr Author i have a portal, which has enabled "allow add new records" i also have another table, which contains a field named "clientnames" that have multiple records i would like to add all the "clientnames" into the portal by using "go to last record and setfield via the field name" But it only adds the first record of "clientnames" only.
April 23, 201213 yr What I am having a hard time with is understanding what tables do you have. I understand there is a table of Clients, and another table of ??. In this table, each record has a return-separated (?) list of client names in a field? Also, is this a one-time conversion, or will you be doing this periodically?
April 23, 201213 yr Author sorry for my poor english 1 table named "sales record", which has 3 fields, "clientnames", "date" and "salesperson" 1 table named "potential sales", which has also 2 fields, "clientnames2" and "salesperson" now i have a layout based on "sales record" which contains portal of "potential sales", linked by "salesperson". i am hoping to copy the all the entries of "clientnames" into "clientnames2". sorry sir for the confusion.
April 23, 201213 yr I am still a bit confused, so let me use a generic example with these two tables: Parent: • ParentID (auto-enter serial number) • ParentName • ChildNames (a return-separated list) Child: • ChildID (auto-enter serial number) • ParentID • ChildName The script to create a related Child record for each name in the ChildNames field would look like: Set Variable [$parentID ; Parent::ParentID ] Set Variable [ $childNames ; Parent::ChildNames ] Go to Layout [ Child ] Loop Set Variable [ $i ; $i + 1 ] Exit Loop If [ $i > ValueCoount ( $childNames ) ] New Record Set Field [ Child::ParentID ; $parentID ] Set Field [ Child::ChildName ; GetValue ( $childNames ; $i ) ] End Loop Go to Layout [ original layout ]
April 23, 201213 yr Author i tried making one sample base on your example, i can't seem to get it working. the value count return as 1 as i tested it on the field. the use of $i is to identify the records, right?
Create an account or sign in to comment