getFirstNoteID (NotesNoteCollection - JavaScript)

コレクション内の最初の文書を取得します。

定義場所

NotesNoteCollection

構文

getFirstNoteID() : string
戻り値 説明
string コレクション内の最初の文書の ID です。

使用法

文書が存在しない場合は、長さが 0 のストリングが返されます。

このボタンは、現在のデータベース内の文書の文書コレクションを作成します。件名にテキスト「example」が含まれる文書をすべて削除し、修正されたコレクションを DXL としてエクスポートします。
// Open DXL file
var stream:NotesStream = session.createStream();
var filename:string = "c:¥¥dxl¥¥";
filename = filename + database.getFileName();
filename = filename.substring(0, filename.length() - 3) + "dxl";
if (stream.open(filename)) {
	requestScope.status = "Opened " + filename;
	stream.truncate();

	// Create note collection
	var nc:NotesNoteCollection = database.createNoteCollection(false);
	nc.setSelectDocuments(true);
	nc.buildCollection();
	
	// Remove note if it contains word example
	var id:string = nc.getFirstNoteID();
	while (id.length() > 0) {
		var tmpid = nc.getNextNoteID(id);
		var doc:NotesDocument = database.getDocumentByID(id);
		var  subject:string = doc.getItemValueString("Subject");
		if (subject.toLowerCase().indexOf("example") >= 0) {
			nc.remove(id);
		}
		id = tmpid;
	}

	// Export note collection as DXL
	var exporter:NotesDxlExporter = session.createDxlExporter();
	var output:string = exporter.exportDxl(nc);
	stream.writeText(output);
	stream.close();
	requestScope.status = requestScope.status + "¥n" + nc.getCount() +
		" notes written to " + filename;
} else {
	requestScope.status = "Cannot open " + filename;
}

言語間の参照

LotusScript® NotesNoteCollection クラスの GetFirstNoteID メソッド

Java™ NoteCollection クラスの getFirstNoteID メソッド