通过View创建NotesdocumentCollection

时间:2015-10-16 08:03:39

标签: lotusscript

我是一个很好的写作小说,但我很难解决问题。 所以..我真的需要你的帮助。

我有一个notesview,它有一个类别,请求类型和列的名称..我需要按类别排序并请求类型。

这是我创建文档集的代码..我不知道它是否正确。

请求类型:删除/添加 类别:" 0001"

Set BadgeCol = badgeview.GetAllDocumentsByKey("Delete",False)
Call BadgeCol.PutAllInFolder("BDel")

Set Badgedoc = badgecol.GetFirstDocument()

我不知道接下来会发生什么......

enter code here

2 个答案:

答案 0 :(得分:2)

以下是一些自定义LotusScript解决方案(LotusScript没有提供解决方案)

但是我建议您对视图进行排序,然后从那里获取文档。

enter image description here

但是,如果LotusScript是您要对集合进行排序的地方,则需要使用自己的排序

答案 1 :(得分:2)

正如Dmytro指出的最好的方法是对视图列进行排序以进行排序。

但要注意:Set BadgeCol = badgeview.GetAllDocumentsByKey("Delete",False)会给你一个未分类的集合。如果您想利用视图排序,则需要使用NotesViewEntryCollection而不是NotesDocumentCollection。在骑自行车方面,两者的工作方式几乎相同。

您的代码可能如下所示:

Dim BadgeCol as NotesViewEntryCollection
Dim badgeEntry as NotesViewEntry
Dim badgeDoc as NotesDocument

Set BadgeCol = badgeview.GetAllEntriesByKey("Delete",False)

Set badgeEntry = badgecol.GetFirstDocument()
While not badgeEntry is Nothing
  Set badgeDoc = badgeEntry.Document

  '- do whatever you need: Read items, create an array, whatever...

  Set badgeEntry = badgecol.GetNextDocument()
Wend