Show / Hide Table of Contents

Class EntityManagementFunctions

Move, merge and copy contact, person and project; as well as replay such events on behalf of travel

Inheritance
object
EntityManagementFunctions
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: SuperOffice.CRM.Entities
Assembly: SoDataBase.dll
Syntax
public static class EntityManagementFunctions
Remarks

The public Copy and Merge methods are the outside entrypoints, as well as the generic PerformOperationFromLog.

Operations are not logged to traveltransactionlog, but instead to mergemovelog, from where they can be replayed. Note that move/merge are not supported on child databases, only on central (once you got out of sync with crossing operations, there would be no way back).

Methods

CopyContactAsync(int, string, string, bool, CancellationToken)

Copy a contact. Activities and related data will be ignored

Declaration
public static Task<int> CopyContactAsync(int sourceContactId, string destinationContactName, string destinationContactDepartment, bool copyPersons, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int sourceContactId
string destinationContactName

The name of the destination contact

string destinationContactDepartment
bool copyPersons

If true, persons will be copied from source contact

CancellationToken cancellationToken
Returns
Type Description
Task<int>

Id of copied contact

Remarks

The public Copy and Merge methods are the outside entrypoints, as well as the generic PerformOperationFromLog.

Operations are not logged to traveltransactionlog, but instead to mergemovelog, from where they can be replayed. Note that move/merge are not supported on child databases, only on central (once you got out of sync with crossing operations, there would be no way back).

DisconnectPersonNoSaveAsync(Person, DateTime, bool, CancellationToken)

Disconnect a person from its contact

Declaration
public static Task DisconnectPersonNoSaveAsync(Person person, DateTime moveAfterDate, bool logOperation = true, CancellationToken cancellationToken = default)
Parameters
Type Name Description
Person person

A person entity with update rights, without ERP links

DateTime moveAfterDate

Only move activites after this date

bool logOperation
CancellationToken cancellationToken
Returns
Type Description
Task
Remarks

The public Copy and Merge methods are the outside entrypoints, as well as the generic PerformOperationFromLog.

Operations are not logged to traveltransactionlog, but instead to mergemovelog, from where they can be replayed. Note that move/merge are not supported on child databases, only on central (once you got out of sync with crossing operations, there would be no way back).

MergeContactsAsync(int, int, bool, bool, bool, CancellationToken)

Merge two contacts. The destination contact will remain.

Declaration
public static Task MergeContactsAsync(int sourceContactId, int destinationContactId, bool mergeIdenticalPersons, bool replaceEmptyFieldsOnDestination, bool logOperation, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int sourceContactId

Source contact to merge from

int destinationContactId

Destination contact to merge into

bool mergeIdenticalPersons

Persons with identical names will be merged

bool replaceEmptyFieldsOnDestination
bool logOperation
CancellationToken cancellationToken
Returns
Type Description
Task
Remarks

The public Copy and Merge methods are the outside entrypoints, as well as the generic PerformOperationFromLog.

Operations are not logged to traveltransactionlog, but instead to mergemovelog, from where they can be replayed. Note that move/merge are not supported on child databases, only on central (once you got out of sync with crossing operations, there would be no way back).

MergePersonsAsync(int, int, DateTime, bool, bool, bool, CancellationToken)

Merge two persons

Declaration
public static Task MergePersonsAsync(int sourcePersonId, int destinationPersonId, DateTime moveAfterDate, bool deleteSource, bool replaceEmptyFieldsOnDestination, bool logOperation, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int sourcePersonId
int destinationPersonId
DateTime moveAfterDate

Only move activities after this date

bool deleteSource

If true the source will be deleted instead of retired and activities before moveAfterDate will have their personId set to 0

bool replaceEmptyFieldsOnDestination
bool logOperation
CancellationToken cancellationToken
Returns
Type Description
Task
Remarks

The public Copy and Merge methods are the outside entrypoints, as well as the generic PerformOperationFromLog.

Operations are not logged to traveltransactionlog, but instead to mergemovelog, from where they can be replayed. Note that move/merge are not supported on child databases, only on central (once you got out of sync with crossing operations, there would be no way back).

MergeProjectsAsync(int, int, bool, bool, CancellationToken)

Merge two projects

Declaration
public static Task MergeProjectsAsync(int sourceProjectId, int destinationProjectId, bool replaceEmptyFieldsOnDestination, bool logOperation, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int sourceProjectId
int destinationProjectId
bool replaceEmptyFieldsOnDestination

Fill in empty fields on destination from source

bool logOperation
CancellationToken cancellationToken
Returns
Type Description
Task
Remarks

The public Copy and Merge methods are the outside entrypoints, as well as the generic PerformOperationFromLog.

Operations are not logged to traveltransactionlog, but instead to mergemovelog, from where they can be replayed. Note that move/merge are not supported on child databases, only on central (once you got out of sync with crossing operations, there would be no way back).

MovePersonAsync(int, int, DateTime, bool, CancellationToken)

Move a person to a specified contact

Declaration
public static Task MovePersonAsync(int personId, int destinationContactId, DateTime moveAfterDate, bool logOperation, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int personId
int destinationContactId
DateTime moveAfterDate

Only move activites after this date

bool logOperation
CancellationToken cancellationToken
Returns
Type Description
Task
Remarks

The public Copy and Merge methods are the outside entrypoints, as well as the generic PerformOperationFromLog.

Operations are not logged to traveltransactionlog, but instead to mergemovelog, from where they can be replayed. Note that move/merge are not supported on child databases, only on central (once you got out of sync with crossing operations, there would be no way back).

PerformOperationFromLogAsync(int, CancellationToken)

Perform a move/merge operation from a MergeMoveLog entry Used for merging from a travel database

Declaration
public static Task PerformOperationFromLogAsync(int logId, CancellationToken cancellationToken)
Parameters
Type Name Description
int logId

The id of the log entry containing the move/merge operation

CancellationToken cancellationToken
Returns
Type Description
Task
Remarks

The public Copy and Merge methods are the outside entrypoints, as well as the generic PerformOperationFromLog.

Operations are not logged to traveltransactionlog, but instead to mergemovelog, from where they can be replayed. Note that move/merge are not supported on child databases, only on central (once you got out of sync with crossing operations, there would be no way back).

UpdateConsentPersonForMergeAsync(int, int, bool, Action<string>, CancellationToken)

Move, merge and copy contact, person and project; as well as replay such events on behalf of travel

Declaration
public static Task UpdateConsentPersonForMergeAsync(int sourcePersonId, int destinationPersonId, bool deleteSource, Action<string> markAsManuallyHandled, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int sourcePersonId
int destinationPersonId
bool deleteSource
Action<string> markAsManuallyHandled
CancellationToken cancellationToken
Returns
Type Description
Task
Remarks

The public Copy and Merge methods are the outside entrypoints, as well as the generic PerformOperationFromLog.

Operations are not logged to traveltransactionlog, but instead to mergemovelog, from where they can be replayed. Note that move/merge are not supported on child databases, only on central (once you got out of sync with crossing operations, there would be no way back).
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top