netCoreSyncSetActiveSyncId method

void netCoreSyncSetActiveSyncId(
  1. String value
)

Set the active syncId from the assigned SyncIdInfo.

The value must be equal to the assigned SyncIdInfo.syncId, or one of the syncId listed in the SyncIdInfo.linkedSyncIds (if any). Read more about this method in Client Side Initialization in the netcoresync_moor documentation for more details.

Implementation

void netCoreSyncSetActiveSyncId(String value) {
  if (!netCoreSyncInitialized) throw NetCoreSyncNotInitializedException();
  if (dataAccess.syncIdInfo == null) {
    throw NetCoreSyncSyncIdInfoNotSetException();
  }
  if (value.isEmpty) {
    throw NetCoreSyncException("The active syncId cannot be empty");
  }
  if (dataAccess.syncIdInfo!.syncId != value &&
      !dataAccess.syncIdInfo!.linkedSyncIds.contains(value)) {
    throw NetCoreSyncException(
        "The active syncId is different than the SyncIdInfo.syncId and also "
        "cannot be found in the SyncIdInfo.linkedSyncIds");
  }
  dataAccess.activeSyncId = value;
}