| Auszug |
|---|
|
Nuclos calculated attribute data source: INTID, $username, $mandator, dynamic background colour, attributeColorSQLWhitelist, SQL example. |
Language: Deutsch · English
Calculated attribute (data source)
Calculated attribute via a data source – with context variables and dynamic background colour for the web client.
| Status |
|---|
| colour | Blue |
|---|
| title | Application developer |
|---|
|
| Status |
|---|
| colour | Green |
|---|
| title | Updated: Jul 2026 |
|---|
|
| Status |
|---|
| colour | Grey |
|---|
| title | applies to Nuclos 4.2026.x |
|---|
|
What is a calculated attribute (data source)?
A calculated attribute is a single return value of a database query that is linked to a field in the business object and shown at runtime – without any user action.
Menu: Configuration → Data sources → Calculated attribute
| Info |
|---|
|
Compared to functions in database objects, data-source-based attributes offer extra context variables such as $username and $mandator (the latter must be bracketed: ('$mandator')). |
Structure
The data source needs a parameter for the INTID of the record where the attribute is shown. The return value must match the value to display; the same data type is chosen when linking it in the business object.
| Warnung |
|---|
|
Do not use t as a table alias in the data source – it is already used by Nuclos and leads to wrong results. Reference fields cannot be calculated. |

Data source of a calculated attribute.
Dynamic background colour (from Nuclos 4.2024.5)
Since Groovy scripts are not evaluated in the web client, a data source of type calculated attribute can return a component's background colour as a hex-encoded string (e.g. #00ff00). Available parameters include: intid, strfield, struidfield, fieldvalue (SQL snippet, whitelist attributeColorSQLWhitelist), username, mandator.
| Codeblock |
|---|
|
select
pm.strvalue
from
t_md_nucletparameter
inner join t_md_mandator_param_value pm on t_md_nucletparameter.struid
where
pm.struid_t_md_nuclet_param where strparameter = 'Nucletparameter x'
and pm.struid_t_md_mandator = ('$mandator') |
| Info |
|---|
|
Priority rich client: Groovy > data source > nuclosrowcolor > static layout colour. Web client: data source > nuclosrowcolor > static layout colour. |
Related pages
Calculated attributes
Concept & DB path.
Open →
Database objects
DB functions.
Open →