# MeasureOperation

**Kind:** Class

**Source:** `Pams/Web/Pams.WebApp/Client/app/core/models/dashboard-data-fields.ts` (line 270)

**Part of:** [Pams](subsystem-pams)

`MeasureOperation` stores display and persistence metadata for a dashboard measure field. It tracks the field name, stored name, caption, measure type, and hidden state for use by dashboard data-field handling.

## Methods

| Method | Signature | Returns |
|---|---|---|
| `isHidden` | `isHidden()` | `boolean` |
| `setHidden` | `setHidden(flag: boolean)` | `void` |
| `GetStoredName` | `GetStoredName()` | `string` |
| `SetStoredName` | `SetStoredName(name: string)` | `void` |
| `GetFieldName` | `GetFieldName()` | `string` |
| `SetFieldName` | `SetFieldName(name: string)` | `void` |
| `GetType` | `GetType()` | `Measure` |
| `SetType` | `SetType(type: Measure)` | `void` |
| `GetCaption` | `GetCaption()` | `string` |
| `SetCaption` | `SetCaption(input: string)` | `void` |
| `SetDataType` | `SetDataType(ty: DataTypeEnum)` | `void` |
| `GetDataType` | `GetDataType()` | `DataTypeEnum` |

## Where it refuses work

- `MeasureOperation` stops the work with an early return when `this.Field.StoredName`.
- `MeasureOperation` stops the work with an early return when `this.Field.FieldName`.

## Diagram

```mermaid
graph LR
  MeasureOperation --> FieldName
  MeasureOperation --> StoredName
  MeasureOperation --> Caption
  MeasureOperation --> MeasureType[Measure]
  MeasureOperation --> HiddenState
```

## Usage

```ts
import { MeasureOperation } from "./core/models/dashboard-data-fields";

const operation = new MeasureOperation();

operation.SetFieldName("Revenue");
operation.SetStoredName("revenue");
operation.SetCaption("Revenue");
operation.setHidden();

console.log(operation.GetFieldName());
console.log(operation.GetStoredName());
console.log(operation.GetCaption());
console.log(operation.isHidden());
```

## AI Coding Instructions

- Use the `Set*` methods to update measure metadata rather than assigning internal properties directly.
- Read values through the matching `Get*` methods when preparing dashboard field configuration.
- Call `setHidden()` and `isHidden()` when filtering fields from dashboard display logic.
- Keep `GetFieldName()` and `GetStoredName()` aligned with the field identifiers expected by the dashboard data source.
- Set the measure type through `SetType()` before code depends on `GetType()`.
