Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.
Auszug
hiddentrue

Nuclos calculated attribute data source: INTID, $username, $mandator, dynamic background colour, attributeColorSQLWhitelist, SQL example.

globe with meridians Language: Deutsch · English

hammer and wrench Calculated attribute (data source)

Calculated attribute via a data source – with context variables and dynamic background colour for the web client.

Status
colourPurple
titleHow-to
Status
colourBlue
titleApplication developer
Status
colourGreen
titleUpdated: Jul 2026
Status
colourGrey
titleapplies to Nuclos 4.2026.x

Panel
bgColor#F4F5F7

On this page

Inhalt
maxLevel2
minLevel2

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
titleAdvantage

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
titleCaution

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.

Codeblock
languagesql
Businessobjekt

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
languagesql
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
titleHierarchy

Priority rich client: Groovy > data source > nuclosrowcolor > static layout colour. Web client: data source > nuclosrowcolor > static layout colour.

Related pages

bar chart Calculated attributes


Concept & DB path.

Open →

file cabinet Database objects


DB functions.

Open →