SETFIELDVALUE Function

Sets the value of a field based on its index in the list of fields coming from the parent node. This is useful for enumerating through the fields and setting values.

Category: Data Input

Syntax

setfieldvalue(<integer,any>)

Required Arguments

integer

is the index into the incoming fields

any

is the value you want to set the field to

Details

The setfieldvalue function sets the value of a field based upon its index in the list of fields coming from the parent node. This is useful for enumerating through the fields and setting values.

Example

// Declare a hidden integer for the for loop, initializing it to 0, and a hidden date field

hidden integer i

i = 0

hidden date Date_Field

 

// Checks each field to see if it is a date field

for i = 1 to FieldCount()

if FieldType(i) == 'Date' then

 

begin

   Date_Field= FieldValue(i)

// If the date is in the future, then use SETFIELDVALUE to set the value to null

   if Date_Field > today()

   SetFieldValue(i,null)

end