| Auszug |
|---|
|
Nuclos SaveFlags: SaveFlag.PATCH and SaveFlag.SKIP_RULES on update in rules, load attributes restricted, load version, performance. |
Language: Deutsch · English
SaveFlags
Control saving: write individual attributes with SaveFlag.PATCH and skip update rules with SKIP_RULES.
| Status |
|---|
| colour | Green |
|---|
| title | Updated: Jul 2026 |
|---|
|
| Status |
|---|
| colour | Grey |
|---|
| title | applies to Nuclos 4.2026.x |
|---|
|
SaveFlags on update
From Nuclos 4.2024.19, SaveFlags can be passed when updating a BO in rules:
| SaveFlag | Effect | since |
|---|
SaveFlag.SKIP_RULES | prevents subsequent update rules (final rules still run) | 4.2024.19 |
SaveFlag.PATCH | write individual attributes without loading all of them | 4.2024.21 |
Example
Previously the whole record was loaded and saved:
| Codeblock |
|---|
|
Article article = Article.get(articleId);
article.setPrice(BigDecimal.valueOf(7.99));
article.save(); |
Since 4.2023.33 records can be loaded restricted to certain attributes. When saving, the PATCH flag is then required – and the version must be loaded too:
| Codeblock |
|---|
|
// nur bestimmte Attribute laden (inkl. Version) und patchen
Article article = Article.get(articleId, Article.Price, Article.Version);
article.setPrice(BigDecimal.valueOf(7.99));
article.save(SaveFlag.PATCH, SaveFlag.SKIP_RULES); |
| Tipp |
|---|
|
Also use SKIP_RULES so no unwanted update rules are triggered. |
Related pages
Server-side rules
Saving in rules.
Open →
Selectively disabling rule execution
Suppress rules.
Open →