getForm (NotesDatabase - JavaScript)

Finds a form in a database, given the form name.

Defined in

NotesDatabase

Syntax

getForm(name:string) : NotesForm
Parameter Description
name The name or an alias of the form.
Return value Description
NotesForm The form whose name or alias matches the parameter.

Usage

An exception occurs if the form does not exist.

Examples

This button gets a form given its name.
try {
	var form:NotesForm = database.getForm(requestScope.query);
	requestScope.status = form.getName();
	var aliases = form.getAliases().iterator();
	if (!aliases.hasNext()) {
		requestScope.status += "\nNo aliases";
	} else {
		while (aliases.hasNext()) {
			requestScope.status += "\n" + aliases.next();
		}
	}
} catch (e) {
	requestScope.status = "No such form";
}