removeItem (NotesDocument - JavaScript)

アイテムを文書から削除します。

定義場所

NotesDocument

構文

removeItem(name:string) : void
パラメータ 説明
name 文書から削除するアイテムの名前。 指定した名前を持つアイテムが複数ある場合は、その名前のアイテムがすべて削除されます。指定した名前を持つアイテムが存在しない場合は、このメソッドを実行しても何も起きません。

使用法

NotesItem の remove を使用しても同じ結果が得られます。

文書に対して行った変更を保持するには、アイテムの削除後に save を呼び出す必要があります。

このボタンは、現在の文書からアイテムを削除します。
var doc:NotesDocument = currentDocument.getDocument();
if (doc.hasItem("quantity")) {
	doc.removeItem("quantity");
	if (doc.save()) {
		requestScope.status = "Quantity item removed";
	} else {
		requestScope.status = "Save failed";
	}
} else {
	requestScope.status = "Document does not have quantity item";
}

言語間の参照

LotusScript® NotesDocument クラスの removeItem メソッド

Java™ Document クラスの removeItem メソッド