FORMULA LANGUAGE


@SetField
Example

Assigns a value to a field stored within a document (use @Set for temporary variables). This is similar to using the FIELD keyword, except that @SetField can be used within another @function. If the field does not exist, this command creates it and applies the specified value to it.

Syntax

@SetField( fieldName ; value )

Parameters

fieldName


value
Usage

This function is most useful in agents, hotspot buttons, actions, and toolbar buttons. It does not work in column, selection, hide-when, window title, or form formulas.

With Release 6, you no longer need to declare the field receiving the assignment prior to setting its value with @SetField. For R5 or earlier clients, declare the field at the beginning of the formula, as follows:


The field that @SetField creates and assigns the specified value to if the specified field does not exist in the document is not visible to the user. You can remove a field added to a form this way using the @DeleteField function.

The value can be anything and does not have to match the type of the field as defined on a form. This function does not reset flags on an existing field and does not set flags for a newly stored field. For example, a Readers field does not become plain text by assigning a text value; and a newly stored field cannot be made a Readers field. The LotusScript and Java classes allow this manipulation through NotesItem and Item.

Language cross-reference

FieldSetText method of LotusScript NotesUIDocument class

ReplaceItemValue method of LotusScript NotesDocument class

replaceItemValue method of Java Document class

Example
See Also