Technote Number: 1089388
Problem:
This issue has been reported to Lotus Software Quality Engineering.
There are a few differences in the documentation on @SetField between Domino 5
Designer Help and Domino 6 Designer Help. In Domino 5 Designer Help, it is
documented that @SetField must be preceded with a declaration of the field
being set.
@SetField( fieldName ; value )
Parameters
fieldName
The name of the field whose value you want to set, enclosed in quotation marks.
If you store the field's name in a variable, omit the quotation marks here.
value
The value you want to give to fieldName. The value must be the same data type
as the field; for example, if the field is numeric, the value must be a number.
Usage
This keyword is most useful in agent, button, hotspot, field, and action
formulas, and SmartIcons. It does not work in column, selection, hide-when,
window title, or form formulas.
Before you use @SetField in your formula, the field receiving the assignment
must have already been declared within the same formula. One way to do this is
to declare it at the beginning of your formula:
FIELD Fieldname:=Fieldname;
In Lotus Domino Designer 6 Help, new functionality does not require the
declaration. However, the option to use a variable for the field name has been
removed.
@SetField( fieldName ; value )
Parameters
fieldName
The name of the field whose value you want to set, enclosed in quotation marks.
value
The value you want to give to fieldName. The value must be the same data type
as the field; for example, if the field is numeric, the value must be a number.
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:
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.
Supporting Information:
The existence of these fields can be determined either with NotesPeek or with a
LotusScript agent that loops through all items in the document, checking for
items with blank name value. For instance, the following code snippet will
loop through all items in docA and prompt with a MessageBox to display the item
name. First, if the item name is blank, you will see a blank message box and
then a second message box will display "NoName".
Set docA = view.getlastdocument
Forall i In docA.items
Messagebox i.name
If i.name = "" Then
Messagebox "NoName"
End If
End Forall
Even though LotusScript can loop through the "no name" items, it is not
possible to remove these items with LotusScript with either item.Remove or
doc.RemoveItem methods.
To remove fields that have been created with no name, use the following
formula:
NoNameField := "";
@SetField(NoNameField; @DeleteField)
IMPORTANT NOTE: The above is a sample script, provided only to a illustrate a
way you can approach this functionality. Notes Support does not support this
script and will not be able to customize it for a customer's specific
configuration.
Related Documents:
More >
| |
|
|
|
|