Aliases (NotesView - JavaScript)

Read-write. The aliases of a view.

Defined in

NotesView

Syntax

getAliases() : java.util.Vector

setAliases(aliases:java.util.Vector) : void

Usage

This property does not return the name of the view. Use getName to get the name.

Old-style aliases that are in the name field, separated from the name by vertical bars, are returned as part of the name.

See setAliases to set aliases as a string.

Examples

This computed field displays the name and aliases of a view associated with a page data source.
var name:string = view2.getName();
var aliases:string = "";
var iterator:java.util.Iterator = view2.getAliases().iterator();
while (iterator.hasNext()) {
	aliases = aliases + (aliases.isEmpty() ? "" : ", ") + iterator.next();
}
return name + (aliases.isEmpty() ? "" : " aka ") + aliases;
This button adds an alias.
var v:NotesView = database.getView("main");
var aliases:java.util.Vector = v.getAliases();
var alias:string = requestScope.query;
if (!alias.isEmpty()) {
	aliases.addElement(alias);
	v.setAliases(aliases);
}
This button removes an alias.
var v:NotesView = database.getView("main");
var aliases = v.getAliases();
if (aliases.length > 0) {
	if (aliases.length == 1) {
		v.setAliases(null);
	} else {
		aliases.removeElement(aliases.lastElement());
		v.setAliases(aliases);
	}
}