EntityMigration
| π 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 (6)
- ποΈ Constructor (2 params)
- βοΈ Functions
- Regular Functions
- sync (2 params) β
$RemoteEntity : 4D.Entity - _functionsExistChecks
- create (2 params) β
$RemoteEntity : 4D.Entity - link (2 params) β
$RemoteEntity : 4D.Entity - get (3 params) β
$RemoteEntity : 4D.Entity - LinkDisplayPropertyValue (1 param) β
Variant - updateLoading (2 params)
- startTransactions
- validateTransactions
- cancelTransactions
- sync (2 params) β
- Computed Attributes (Getters/Setters/Query/OrderBy)
- _MigrationSettings π β
Object - DataClassName π β
Text - LinkAdditionalInfoProperty π β
Text - LinkDisplayProperty π β
Text - LinkingEnabled π β
Boolean - MigrationPropertyExists π β
Boolean - NewEntityPropertyFormulas π β
Collection
- _MigrationSettings π β
- Regular Functions
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
link
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