|
This function will retrieve the next
highest field value.
TID(Field , SQL , Server)
PARAMETERS
Field
The Field you wish to retrieve the next highest value from.
(Note: Must be an integer
field)
SQL
The SQL statement which determines which records to
count.
Server
The Server used to query against .. use --- for the local
device
Example: Return
the next highest value in the ID field, and store it in the ID field of
every newly created record.
Add the following code to your forms ON ADD
event.
SETVALUE(~ID~//TID(“ID”,”SELECT ID FROM
MyTable”,”---“))
It is usually better to use the
NEXTID function. TID will
only return the next highest value.
Thus if the last record of a table is deleted, and TID is performed
again, a duplicate value will be generated. NEXTID does not permit multiple
uses of the same value. |