Sequence Numbers Component
Fnd_SqNo_SetRecordID
Fnd_SqNo_SetRecordID ({->table})
Parameters
| Parameter | Type | Description |
|---|---|---|
| table | Pointer | The table for which to return a number (optional) |
Description
Although you can use the Fnd_SqNo_Get function to get sequence numbers to be used as record IDs, we would like to suggest another method. The Fnd_SqNo_SetRecordID method is designed specifically to assign a value for a table. Pass it a pointer to the table for which you want it to assign a new number, and it will assign a unique value to the key field. Pass this routine a pointer to the table for which you want it to set the unique record ID number. If no table is specified, either the current form table or the trigger table will be used. This method will check to see if the record already has an ID number. If it does not, this routine will assign it a number. Case of : (Form event=On Load ) Fnd_SqNo_SetRecordID End case
This routine will call the Fnd_Hook_SqNo_SetIDField hook to determine which field is the key field for the table. It assumes you are using a long integer key field. One of the benefits of using this routine rather than the Fnd_SqNo_Get function is this routine tracks the unique numbers by the table number, not by the table’s name. So you can safely change the name of a table without updating any calls to this method. Sequence numbers assigned using this function can also be “fixed” using the Fix button in the Sequence Number Editor or by calling the Fnd_SqNo_Fix method. You cannot return an unused ID number for reuse, since ID fields should not contain data that will be important to the end-users. By not returning numbers to the sequence number for reuse, there is less need to worry about causing delays for other users and processes wishing to access this function for the same table.
Extracted source text
Fnd_SqNo_SetRecordID ({->table})
Parameter Type Description
table Pointer The table for which to return a number (optional)
Although you can use the Fnd_SqNo_Get function to get sequence numbers to be used as record
IDs, we would like to suggest another method. The Fnd_SqNo_SetRecordID method is designed
specifically to assign a value for a table. Pass it a pointer to the table for which you want it to assign a new
number, and it will assign a unique value to the key field.
Pass this routine a pointer to the table for which you want it to set the unique record ID number. If no
table is specified, either the current form table or the trigger table will be used. This method will check to
see if the record already has an ID number. If it does not, this routine will assign it a number.
Case of
: (Form event=On Load )
Fnd_SqNo_SetRecordID
End case
This routine will call the Fnd_Hook_SqNo_SetIDField hook to determine which field is the key field
for the table. It assumes you are using a long integer key field.
One of the benefits of using this routine rather than the Fnd_SqNo_Get function is this routine tracks
the unique numbers by the table number, not by the table’s name. So you can safely change the name
of a table without updating any calls to this method. Sequence numbers assigned using this function can
also be “fixed” using the Fix button in the Sequence Number Editor or by calling the Fnd_SqNo_Fix
method.
You cannot return an unused ID number for reuse, since ID fields should not contain data that will be
important to the end-users. By not returning numbers to the sequence number for reuse, there is less
need to worry about causing delays for other users and processes wishing to access this function for the
same table.