May 4, 200421 yr Can anyone help with a script to generate 10 new records. The records in 2 fields are to be a sequential increase in value by 1 from the previous record but the record in a third field is to be the same for all the new records. Thanks
June 7, 200421 yr SetField(g_n_counter, 10) SetField(g_n_field1, 1) SetField(g_n_field2, 1) SetField(g_t_field1, ""data you want"") Loop NewRecordRequest SetField(field1, g_n_field1) SetField(field2, g_n_field2) SetField(field3, g_t_field1) SetField(g_n_field1, g_n_field1 + 1) SetField(g_n_field2, g_n_field2 + 1) SetField(g_n_counter, g_n_counter - 1) ExitLoopIf(g_n_fcounter = 0) EndLoop My shorthand is as follows g_n_... = global number g_t_... = global text
June 8, 200421 yr But how do you get the (g_n_field...) to work??? There is no option in the menu. I assume this is generate new/numeric field. Thanks in advance. Adam.
June 8, 200421 yr 'g_n_' just the naming convention I use. The field should be defined as a Global Number field under your field definitions. You may name the fields whatever suits you best.
June 9, 200421 yr beginner question say you want to use the values stored somewhere else to start off your script. How does one "get" the value of a field in another table, and put it into the global variable to start?
June 9, 200421 yr Set up a a constant relationship. In the two files you want to relate together, create a constant key,... define a field as a calculation, = 1, defined as a number. Create the relationship in the file you want to push the information from. In the table where you have the stored data, set the stored value into the related global field. You now have the data at your disposal. Note that there are several ways to get this info, but this should suffice your needs and shows one way to utilize a constant relationship.
June 9, 200421 yr In versions < 7, an invalid relationship (e.g. global to global) can work much faster than a constant to constant one, especially if there are hundreds or thousands of records in the related file, since the constant relationship has to get the ids of all related records first. In version 7, global fields are accessible without a relationship. You simply Set Field [table::global, table1::field] or Set Field [table::global, value].
Create an account or sign in to comment