作成者カテゴリ返答の対象
公開
寝雪
09/17/2010 11:36 AM
文書リンクアイコン Querydocumentdelete
Re: Querydocumentdelete

削除権限があるわけですから、特定のビュー以外で削除を実行できないように
Querydocumentdeleteを設定する必要が出てくるので二度手間です。


概要だけ書いておきます。当然メッセージやExit、場合によってはGotoが必要です。
調べて理解できたところだけ使ってください。
対象ロールや設計名を配列で格納するようにすれば、汎用化可能です。

Sub Querydocumentdelete(Source As Notesuidatabase, Continue As Variant)
'選択文書取得
Set dc = Source.Documents 'db.UnprocessedDocumentsは不可

'ロールチェック
Continue = False
Set nam = session.CreateName(session.UserName)
Set acl = db.ACL
Set entry = acl.GetEntry(nam.Canonical)
If Not entry Is Nothing Then
Forall r In entry.Roles
If r = "[削除可能ロール]" Then
Continue = True

'ビューでチェックする場合
Set view = workspace.CurrentView
if view.ViewName <> "削除可能ビュー" then
Continue = False

'フォーム要素でチェックする場合
Set doc = dc.GetFirstDocument()
While Not(doc Is Nothing)
If doc.Form(0) <> "対象フォーム" Then
Continue = False



こんなん判るか、という場合は
・全員から削除権限をはく奪
・特定ロールだけが見える削除フラグ追加ボタンを作成
・フラグが立ってる文書はビューから非表示
・定期エージェントでフラグが立ってる文書を全部削除
とすればややこしいことは考えなくてOKです。


[Previous Main Document]
Querydocumentdelete (ボッチ)
. . Re:Querydocumentdelete (アンヌ)
. . . . Re: Querydocumentdelete (ボッチ)
. . . . . . Re:Querydocumentdelete (アンヌ)
. . . . . . Re:Querydocumentdelete (アンヌ)
. . . . . . . . Re: Querydocumentdelete (ボッチ)
. . . . . . . . . . Re:Querydocumentdelete (アンヌ)
. . . . . . . . . . . . Re: Querydocumentdelete (ボッチ)
. . . . . . . . . . . . . . Re:Querydocumentdelete (アンヌ)
. . . . . . . . . . . . . . . . Re: Querydocumentdelete (寝雪) * 現在地 *
. . . . . . . . . . . . . . . . . . Re: Querydocumentdelete (ボッチ)
[Next Main Document]