Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions docs/en/low-code/formula-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,36 @@ Both kinds can participate in filtering, sorting, paging, count, projection, gro

Calculated and rollup properties can be authored in a writable Runtime JSON-backed layer that supports direct model changes. The corresponding commands are disabled when the selected Designer layer does not support them.

## Model definition

A formula definition stores only the expression and its result type. Dev JSON does not require generated identifiers, definition hashes, or a dependency list:

```json
{
"name": "LineTotal",
"type": "decimal",
"isMappedToDbField": false,
"formula": {
"expression": "UnitPrice * Quantity",
"resultType": "decimal"
}
}
```

The equivalent code-layer definition is also minimal:

```csharp
property.Formula = new EntityFormulaDescriptor
{
Expression = "UnitPrice * Quantity",
ResultType = EntityPropertyType.Decimal
};
```

The model loader parses the expression and derives its dependencies whenever the layer is loaded or refreshed. Do not persist `formulaId`, `definitionVersion`, or `dependencies`; they are not authored model fields.

Rollups likewise store only their source entity, foreign key, optional value property, and operation. They do not use generated identifiers, definition versions, or authored dependency lists.

## Create a calculated property

In the Low-Code Designer:
Expand Down
4 changes: 2 additions & 2 deletions docs/en/low-code/model-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ Entities describe the persisted data model. UI is not configured with legacy pro
| `isMappedToDbField` | Whether a dynamic scalar property uses a dedicated physical column instead of dynamic data storage |
| `decimalPlaces` | Decimal scale for `decimal` and `money` properties |
| `currencySymbol` | Optional UI currency symbol for `money` properties |
| `collection` | Primitive collection settings: `maxCount`, required `uniqueItems`, and stable `storageKey` |
| `collection` | Primitive collection settings: optional `maxCount` and `uniqueItems` |
| `foreignKey` | Lookup relation metadata |
| `validators` | Backend/UI validation rules |

Expand All @@ -261,7 +261,7 @@ For virtual calculated fields and related-record aggregates, see [Calculated and
| `enum` | Integer-backed enum; requires `enumType` |
| `file`, `image` | Upload metadata handled by the low-code file pipeline |

Add `collection` to any supported primitive type to store an ordered value list. Do not hand-edit a generated `storageKey` after data exists.
Add `collection` to any supported primitive type to store an ordered value list.

### File, Image, and Attachments

Expand Down
Loading