EntityMigrationRule
| 📊 Overview: 2 Properties | 1 Constructor | 6 Functions |
📝 Description
Adds rule to overwrite remote property with local property value unconditionally
🕐 Last updated: 2025-12-10T11:45:22.802Z
📑 Table of Contents
- 📋 Properties (2)
- 🏗️ Constructor
- ⚙️ Functions
- Regular Functions
- overwrite (1 param) →
cs.EntityMigrationRule - fillIfBlank (1 param) →
cs.EntityMigrationRule - addFormula (3 params) →
cs.EntityMigrationRule - addCriteria (1 param) →
cs.EntityMigrationRule - addEntity (4 params) →
cs.EntityMigrationRule - apply (2 params)
- overwrite (1 param) →
- Regular Functions
Properties
| Property | Type | Default | Description |
|---|---|---|---|
FormulaObjectCollection | Collection | [] | Collection of formula objects to apply during migration |
CriteriaCollection | Collection | [] | Collection of criteria formulas to evaluate before applying rules |
Constructor
constructor
[🏗️ constructor]
Class constructor
Creates a new entity migration rule with empty formula and criteria collections
Functions
Regular Functions
overwrite
Function overwrite($PropertyName : Text) -> cs.EntityMigrationRule
Adds rule to overwrite remote property with local property value unconditionally
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
$PropertyName | Text | - | - |
Returns: cs.EntityMigrationRule
fillIfBlank
Function fillIfBlank($PropertyName : Text) -> cs.EntityMigrationRule
Adds rule to fill remote property only if blank using local property value
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
$PropertyName | Text | - | - |
Returns: cs.EntityMigrationRule
addFormula
Function addFormula($Formula : 4D.Function; $SecondParameter : Variant; $CheckProperty : Text) -> cs.EntityMigrationRule
Adds a custom formula to the migration rule with optional second parameter and property check
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
$Formula | 4D.Function | - | - |
$SecondParameter | Variant | - | - |
$CheckProperty | Text | - | - |
Returns: cs.EntityMigrationRule
addCriteria
Function addCriteria($Formula : 4D.Function) -> cs.EntityMigrationRule
Adds a criteria formula that must return true for migration rules to be applied
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
$Formula | 4D.Function | - | - |
Returns: cs.EntityMigrationRule
addEntity
Function addEntity($DataClass : 4D.DataClass; $LocalEntity : 4D.Entity; $Formula : 4D.Function; $Sync : Boolean) -> cs.EntityMigrationRule
Adds a related entity to the migration rule, optionally syncing it first, then applies formula with remote entity
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
$DataClass | 4D.DataClass | - | - |
$LocalEntity | 4D.Entity | - | - |
$Formula | 4D.Function | - | - |
$Sync | Boolean | - | - |
Returns: cs.EntityMigrationRule
apply
Function apply($LocalEntity : 4D.Entity; $RemoteEntity : 4D.Entity)
Applies all formulas in this rule to sync data from local to remote entity after checking criteria
Parameters:
| Name | Type | Optional | Description |
|---|---|---|---|
$LocalEntity | 4D.Entity | - | - |
$RemoteEntity | 4D.Entity | - | - |
Generated from EntityMigrationRule.4dm