DataRecordDuplicate

Note: This page includes content based on the F1 documentation for Centura development. It may be partially converted to support APF development, but should be regarded to be of uncertain actuality. It is provided as is. Eventually, it should be replaced by documentation available from within Visual Studio.

SalNumber DataRecordDuplicate( SalNumber nWhat )

Applications and the framework call the DataRecordDuplicate method to duplicate the current record in a data source.

Parameters

Name Description
SalNumber nWhat Standard method parameter. Possible values are Const.METHOD_Inquire, Const.METHOD_Execute, Const.METHOD_GetType.

Returns

When nWhat = Const.METHOD_Inquire: the return value is TRUE if the new operation is available, FALSE otherwise.

When nWhat = Const.METHOD_Execute: the return value is TRUE if the record was successfully created, FALSE otherwise.

When nWhat = Const.METHOD_GetType, the return value is Const.CHILDTYPE_SourceMethod.

Comments

Duplicating a record is done in the following way:

  1. Store values of current record
  2. Create space for new record (e.g. clear fields or insert a new table row)
  3. Get values of parent keys from parent data source (if any)
  4. Call DataRecordGetDefaults to get client default values
  5. Call DataRecordPrepareNew to get server default values
  6. Clear all child data sources (if any)
  7. Put the stored values in the new record.

For a field to get a stored value in step 7, the field must be editable and insertable. If the field is an attribute the stored values overwrite any client or server default values. If the field is a key, the stored values will NOT overwrite any client or server default values.

DataRecordDuplicate is called automatically by the framework when a data source receives the PM_DataRecordDuplicate message.