Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Variables

Type

Description

field.name

java.lang.String

Returns the current field name.

field.datatype

java.lang.String

Returns the current field data type.

field.value

depends on field data type

String, Long, Double, Boolean, Date, Timestamp

Update the current field value by assigning new value as necessary. Obviously field.value represent current value of the field as well.

Code Block
languagegroovy
if (field.value == '' || field.value == null) 
{
   if (form.type.equalsIgnoreCase("Emergency")) 
   {
      field.value = "Priority 1"
   }
   else 
   {
     field.value = "Priority 2"
   }
 } 

field.state.required

java.lang.Boolean

Overrides the current field required property. True or False.

Code Block
languagegroovy
if (form.DOWN_TIME_REQUIRED!= null &&  form.DOWN_TIME_REQUIRED== true) 
{
    field.state.required = true;
} 

field.state.disabled

java.lang.Boolean

Overrides the current field disabled property. True or False.

Code Block
languagegroovy
if (field.value != '' && field.value != null) 
{
    field.state.disabled = true;
}

field.state.hidden

java.lang.Boolean

Overrides the current field hidden property. True or False.

Code Block
languagegroovy
// Hide field based on other field value.
if (form.VENDOR_NOT_FOUND != null &&  form.VENDOR_NOT_FOUND == false) 
{
      field.state.hidden = true      
}  
 

field.state.maxValue

java.lang.Long

Overrides the current field maxValue property.

Code Block
languagegroovy
  field.state.maxValue = 10000

field.state.minValue

java.lang.Long

Overrides the current field minValue property.

Code Block
languagegroovy
  field.state.minValue = 100

field.state.maxLength

java.lang.Long

Overrides the current field maxLength property.

Code Block
languagegroovy
  field.state.maxLength = 255