September 22, 200619 yr Newbies I have a layout and there are several fields and i have a counter. I want to add new records but set some filelds sometimes previous record. I tried set ( filed::a) getnthrecord ( field::a , getfield ( field::counter ) - 1 ) counter is auto enter serial field but it didnt work. how can i add new record with some fields are duplicated by previous..?
September 22, 200619 yr I assume you want to create a new record and copy the data of some fields from the current record. I suggest you create a script that would go something like this: 1. set variable $a, table::a 2. set variable $b, table:: //this copies your the content of your fields from current table into memory...then create a new record and write the content of these variables into newly created record 3. New Record/Request 4. Set Field(table::a, $a) 5. Set Field(table:, $:
September 22, 200619 yr Have you considered using the Insert from Last Visited script step? You'll be able to avoid declaring one variable for each field you want to copy. One limitation with the Insert from Last Visited script step is that the fields have to be on the current layout. It sounds like this is the case with your solution. Also, you need to make sure you select at least one field on the record you want to duplicate before running the script. This selects the record has the last visited. For example: Go to Next Field New Record/Request Insert from Last Visited [MYTABLE:field1] Insert from Last Visited [MYTABLE:field3] Insert from Last Visited [MYTABLE:field7]
Create an account or sign in to comment