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.
@SetField( fieldName ; value )
fieldName
The name of the field whose value you want to set, enclosed in quotation marks.
value
Text, number, time-date, time-date range, or list thereof. The value you want to give to fieldName.
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:
FIELD Fieldname:=Fieldname;
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.
FieldSetText method of LotusScript NotesUIDocument class
ReplaceItemValue method of LotusScript NotesDocument class
replaceItemValue method of Java Document class
See examples