Script Methods for Fields

The following are the basic methods provided for all fields. Each type of field may have additional methods provided.

Tip: If using these script methods in a business rule, select the Rhino script engine.

Tip: Script methods with names beginning with get or is retrieve the current value for a property. Script methods with names beginning with set or move configure a value for the property.

Method

Value

Description

getName()

String

The name of the field.

Example

var name = Field.getName();

getType()

String

The type of the field.

Accepted return values:

  • barcode
  • box
  • circle
  • line
  • text

Example

var type = Field.getType();

getDataRef()

setDataRef(String)

String

The alias of the field. This is not the fully qualified key.

Examples

var alias = Field.getDataRef();

Field.setDataRef("/myref");

getFullyQualifiedKey()

String

The fully qualified key for the field.

Namespace

Name

Data Ref

Value

body

nm

--

/body/nm

body

nm

dr

/body/dr

body

nm

/dr

/dr

Example

var fqn = getFullyQualifiedKey();

isVisible()

setVisible(boolean)

boolean

Whether the field is visible.

Example

var visible = Field.isVisible();

Field.setVisible(true);

getFormatProxy()

Field format object

The field format object from the field.

Example

var format = Field.getFormatProxy();

getDefaultData()

setDefaultData(String)

String

The value of the default data.

Examples

var default = Field.getDefaultData();

Field.setDefaultData("newvalue");

getPrintingValue(MAP)

String

The value that will be used for this field at print time. The data mapClosed A repository for the data for use when responding to a print request. Each data map entry is composed of a name (key) and a value. must be passed to the method because the value may come from the data map.

Example

var value = Field.getPrintingValue(MAP);

getData()

setData(String)

String

The value of the current static data for the field. By default, the return value is null.

setData() overrides the default data and the MAP values and sets the isDataSet flag to true.

Examples

Field.setData("myvalue");

Field.getData();

clearData()

 

Clear the static data from the field and reset the isDataSet flag to false.

Example

clearData();

isDataSet()

boolean

Whether the data has been statically set on the field.

Example

var set = Field.isDataSet();