getValue (NotesXspDocument - JavaScript™)
Gets the value of an item.
Syntax
getValue(fieldName:any) : any
Parameter | Description |
---|---|
fieldName |
The name of the item. |
Return value | Description |
---|---|
any |
The item value. |
Usage
If multiple items have the same name, this method returns the value of the first item.If the item does not exist, this method returns null.
This method returns a single value as a scalar.
This method returns multiple values in a vector.
Examples
This button onclick event totals the numbers in a multivalue item.var v:java.util.Vector = document1.getValue("numbers");
var vi = v.iterator();
var total = 0.0;
while (vi.hasNext()) {
total = total + vi.next() * 1.0; // need * 1.0 to force vi.next() to number
}
document1.setValue("numbers", total)