When writing an event-handling function for a replication, you often need to consider which type of operation (INSERT, UPDATE, DELETE) is being performed during the replication. In your replication script, use the record's OperationType property to identify the type of operation being performed, as in the following VB.NET example.
Public Overrides Sub Record_onAfterMapping(recSource As IRecord, recTarget As IRecord, By Ref AbortRecord As Boolean)
if (recSource.OperationType = enmOperationType.Update)
AddLog(recSource.GetValueBefore(0), 0)
End if
End SubDepending on the operation type, different functions for accessing source and target values are available.
INSERT Operations
Replication Types: Refresh (all records) and mirroring/synchronization (insert operations obtained from the transaction log)
Record Functions Available:
Source Record | Target Record |
|---|---|
Note
Depending on the event function you are using, source or target record objects may not be available. Check the parameters for the event to see which objects you can use.
UPDATE Operations
Replication Types: Mirroring/synchronization (update operations obtained from the transaction log)
Record Functions Available:
Source Record | Target Record |
|---|---|
* Values before an operation are not always available in the log and therefore these functions may return Null.
** These functions are rarely used.
Note
Depending on the event function you are using, source or target record objects may not be available. Check the parameters for the event to see which objects you can use.
DELETE Operations
Replication Types: Mirroring/synchronization (delete operations obtained from the transaction log)
Record Functions Available:
Source Record | Target Record |
|---|---|
* Values before an operation are not always available in the log and therefore these functions may return Null.
** These functions are rarely used.
Note
Depending on the event function you are using, source or target record objects may not be available. Check the parameters for the event to see which objects you can use.
Related Topics