Suppression "Logique" des Document

Suppression "Logique" des Document

Messagepar Michael DELIQUE » 10 Nov 2010 à 08:59

Ajouter une vue ayant pour Select Form="$$_Trash" pour visualiser les documents "supprimer"

Code : Tout sélectionner
Sub DocDeleteSoftMark(wDoc As NotesDocument,wUser As String)
   
   'supprime de maniere loqique un document
   Dim nmUser As NotesName
   Dim Session As NotesSession
   
   On Error Goto ErreurHandle
   
   If wDoc Is Nothing Then
      Error 9999,"Doc is Nothing"
      Exit Sub
   Elseif Trim(wDoc.GetItemValue("Form")(0)) = "$$_Trash" Then
      Exit Sub
   End If
   
   If Trim(wUser) = "" Then
      Set Session = New NotesSession
      Set nmUser = New NotesName(Session.UserName)
   Else
      Set nmUser = New NotesName(Trim(wUser))
   End If
   
   Call wDoc.ReplaceItemValue("Form_Old",wDoc.GetItemValue("Form")(0))
   Call wDoc.ReplaceItemValue("Form","$$_Trash")
   Call wDoc.ReplaceItemValue("FlagTrash","1")
   Call wDoc.ReplaceItemValue("dteTrash",Now)
   Call wDoc.ReplaceItemValue("nmTrash",nmUser.Abbreviated)
   Call wDoc.Save(True,False)
   
   Set nmUser = Nothing
   
   Exit Sub
ErreurHandle:
   Msgbox "("+Cstr(Getthreadinfo (1))+" Call by "+Cstr(Getthreadinfo(10))+")"+Chr(10)+"Erreur " + Str(Err) + " : "+Chr(10) + Cstr(Error)+". "+Chr(10)+"Ligne N° "+Cstr(Erl),16," ERREUR !"
   Exit Sub
End Sub


Code : Tout sélectionner
Public Sub DocDeleteSoftRestaure(wDoc As NotesDocument)
   
   'restaure le document passé en parametre
   
   
   On Error Goto ErreurHandle
   
   If wDoc Is Nothing Then
      Error 9999,"wDoc is Nothing"
      Exit Sub
   Elseif Trim(wDoc.GetItemValue("Form")(0)) <> "$$_Trash" Then
      Exit Sub
   End If
   
   Call wDoc.ReplaceItemValue("Form", wDoc.GetItemValue("Form_OLD")(0))
   Call wDoc.ReplaceItemValue("Form_Old","")
   Call wDoc.RemoveItem("Form_Old")
   Call wDoc.ReplaceItemValue("FlagTrash","")
   Call wDoc.RemoveItem("FlagTrash")
   Call wDoc.ReplaceItemValue("dteTrash","")
   Call wDoc.RemoveItem("dteTrash")
   Call wDoc.ReplaceItemValue("nmTrash","")
   Call wDoc.RemoveItem("nmTrash")
   Call wDoc.Save(True,False)
   
   Exit Sub
ErreurHandle:
   Msgbox "("+Cstr(Getthreadinfo (1))+" Call by "+Cstr(Getthreadinfo(10))+")"+Chr(10)+"Erreur " + Str(Err) + " : "+Chr(10) + Cstr(Error)+". "+Chr(10)+"Ligne N° "+Cstr(Erl),16," ERREUR !"
   Exit Sub
End Sub


Code : Tout sélectionner
Public Sub DocDeleteSoftRestaure(wDoc As NotesDocument)
   
   'restaure le document passé en parametre
   
   
   On Error Goto ErreurHandle
   
   If wDoc Is Nothing Then
      Error 9999,"wDoc is Nothing"
      Exit Sub
   Elseif Trim(wDoc.GetItemValue("Form")(0)) <> "$$_Trash" Then
      Exit Sub
   End If
   
   Call wDoc.ReplaceItemValue("Form", wDoc.GetItemValue("Form_OLD")(0))
   Call wDoc.ReplaceItemValue("Form_Old","")
   Call wDoc.RemoveItem("Form_Old")
   Call wDoc.ReplaceItemValue("FlagTrash","")
   Call wDoc.RemoveItem("FlagTrash")
   Call wDoc.ReplaceItemValue("dteTrash","")
   Call wDoc.RemoveItem("dteTrash")
   Call wDoc.ReplaceItemValue("nmTrash","")
   Call wDoc.RemoveItem("nmTrash")
   Call wDoc.Save(True,False)
   
   Exit Sub
ErreurHandle:
   Msgbox "("+Cstr(Getthreadinfo (1))+" Call by "+Cstr(Getthreadinfo(10))+")"+Chr(10)+"Erreur " + Str(Err) + " : "+Chr(10) + Cstr(Error)+". "+Chr(10)+"Ligne N° "+Cstr(Erl),16," ERREUR !"
   Exit Sub
End Sub
Cordialement

Michael (SMS-Phobique)
----------------------------
"La théorie, c'est quand on sait tout et que rien ne fonctionne. La pratique, c'est quand tout fonctionne et que personne ne sait pourquoi."
Albert EINSTEIN
Avatar de l’utilisateur
Michael DELIQUE
Administrateur
Administrateur
 
Message(s) : 12183
Inscrit(e) le : 16 Déc 2004 à 10:36
Localisation : Paris/Cergy

Retour vers Divers