Skip to main content

RecordCopier C++ Class

Important

This C++ SDK uses outdated technology that limits your extension opportunities. We've built a new Platform SDK using Python and the latest open-source technology to deliver a vastly improved development experience. Go to Platform SDK to get started!

The RecordCopier class provides a system for managing and duplicating new records based on an existing record. RecordRef represents a reference to a record’s underlying data, and can be accessed & manipulated via the RecordCopier class.

Methods

__init__

Instantiates a new instance of the RecordCopier class.

__init__((RecordInfo)destination, (RecordInfo)source, (bool)suppress_size_only_conversion_errors=False, (str)decimal_separator='.') -> None :

  • destination: The RecordInfo object that represents the connection to which the data is copied.

  • source: The RecordInfo object that represents the connection from which the data is copied.

  • suppress_size_only_conversion_errors: An option to suppress errors that occur during data conversion when the destination field size is too small.

  • decimal_separator: An option that sets the decimal separator when making string-to-number or number-to-string conversions. The option can be set to equal '.' or ','.

Add

Adds a field index mapping to the list of field mappings stored by RecordCopier by specifying the destination and source field indexes.

add((int)destination_field_num, (int)source_field_num) -> None :

  • destination_field_num: The zero-based index of the field in the destination RecordInfo object.

  • source_field_num: The zero-based index of the field in the source RecordInfo object.

Call RecordCopier.done_adding when you are finished adding field mappings.

Copy

Copies the contents of the source RecordRef into the destination RecordCreator based upon the RecordCopier's field mapping. The field mappings must match between the RecordRef and the destination RecordCreator.

copy((RecordCreator)destination, (RecordRef)source) -> None :

RecordCopier.done_adding must be called before this function to achieve a successful copy.

DoneAdding

Notifies the RecordCopier that all field mappings have been added.

done_adding() -> None :

IsValid

Evaluate if the field mappings are valid. Returns True if the mappings are valid.

bool IsValid()

It is best practice to evaluate field mappings before attempting to copy records.

set_dest_to_null

Sets the field values for the destination RecordCreator to [Null].

set_dest_to_null((RecordCreator)destination) -> None :