EntityMigration GitHub

πŸ“Š Overview: 6 Properties 1 Constructor 10 Functions 7 Getters

πŸ“ Description

Initializes migration manager for a specific dataclass with optional remote selection for linking

πŸ• Last updated: 2025-12-10T11:45:22.750Z


πŸ“‘ Table of Contents


Properties

Property Type Default Description
_RemoteDataStore 4D.DataStoreImplementation DataStore(2) Remote datastore connection for migration target
_DataClass 4D.DataClass - Local dataclass being migrated
LinkFunctionCancelled Boolean False Flag indicating user cancelled the link dialog
RemoteDataClass 4D.DataClass - Remote dataclass corresponding to local dataclass
LinkRemoteSelection 4D.EntitySelection - Remote entities available for linking
Loading cs.Loading - Loading indicator for migration progress

Constructor

constructor

[πŸ—οΈ constructor]

Class constructor($DataClass : 4D.DataClass; $LinkRemoteSelection : 4D.EntitySelection)

Initializes migration manager for a specific dataclass with optional remote selection for linking

Parameters:

Name Type Optional Description
$DataClass 4D.DataClass - -
$LinkRemoteSelection 4D.EntitySelection - -

Functions

Regular Functions

sync

Function sync($Entity : 4D.Entity; $PreventSync : Boolean) -> $RemoteEntity : 4D.Entity

Synchronizes local entity with remote entity, applying migration rules to update remote properties

Parameters:

Name Type Optional Description
$Entity 4D.Entity - -
$PreventSync Boolean - -

Returns: 4D.Entity


_functionsExistChecks

Function _functionsExistChecks

Development helper to verify required migration functions exist on entity classes (currently inactive)


create

Function create($Entity : 4D.Entity; $PreventSync : Boolean) -> $RemoteEntity : 4D.Entity

Create a new remote entity from local entity, applying initial property formulas

Parameters:

Name Type Optional Description
$Entity 4D.Entity - -
$PreventSync Boolean - -

Returns: 4D.Entity


Function link($Entity : 4D.Entity; $PreventSync : Boolean) -> $RemoteEntity : 4D.Entity

Prompt user to link local entity to existing remote entity or create new one

Parameters:

Name Type Optional Description
$Entity 4D.Entity - -
$PreventSync Boolean - -

Returns: 4D.Entity


get

Function get($Entity : 4D.Entity; $LinkEntity : Boolean; $PreventSync : Boolean) -> $RemoteEntity : 4D.Entity

Retrieve remote entity by MigrationID, optionally linking if not found

Parameters:

Name Type Optional Description
$Entity 4D.Entity - -
$LinkEntity Boolean - -
$PreventSync Boolean - -

Returns: 4D.Entity


LinkDisplayPropertyValue

Function LinkDisplayPropertyValue($Entity : 4D.Entity) -> Variant

Get the display value for an entity, using LinkDisplayProperty or primary key

Parameters:

Name Type Optional Description
$Entity 4D.Entity - -

Returns: Variant


updateLoading

Function updateLoading($LoadingText : Text; $Entity : 4D.Entity)

Update migration progress log with color-coded status messages

Parameters:

Name Type Optional Description
$LoadingText Text - -
$Entity 4D.Entity - -

startTransactions

Function startTransactions

Begin transactions on both local and remote datastores


validateTransactions

Function validateTransactions

Commit transactions on both local and remote datastores


cancelTransactions

Function cancelTransactions

Rollback transactions on both local and remote datastores


Computed Attributes (Getters/Setters/Query/OrderBy)

_MigrationSettings

[πŸ” get only]

Function get _MigrationSettings -> Object

Migration settings from the dataclass’s getMigrationSettings function

Returns: Object


DataClassName

[πŸ” get only]

Function get DataClassName -> Text

Name of the local dataclass being migrated

Returns: Text


LinkAdditionalInfoProperty

[πŸ” get only]

Function get LinkAdditionalInfoProperty -> Text

Additional property to show during linking for context

Returns: Text


LinkDisplayProperty

[πŸ” get only]

Function get LinkDisplayProperty -> Text

Property name to display when linking entities

Returns: Text


LinkingEnabled

[πŸ” get only]

Function get LinkingEnabled -> Boolean

Whether interactive linking is enabled for this migration

Returns: Boolean


MigrationPropertyExists

[πŸ” get only]

Function get MigrationPropertyExists -> Boolean

Check if the dataclass has a MigrationID property

Returns: Boolean


NewEntityPropertyFormulas

[πŸ” get only]

Function get NewEntityPropertyFormulas -> Collection

Collection of formulas to apply when creating new remote entities

Returns: Collection



Generated from EntityMigration.4dm