Delete specific doc using LS

Hi,

I changed the entry in a readers field and now the document no longer shows in a view. I need to delete the document but I can’t do it through a view so I am trying to write a backend LS routine to find the document by the value in a field (AQCB).

Here is what I have but I get an error on AQCBnum = doc.FieldGetText( “AQCB”).

I know that is a UIdoc method but what is the equivalent doc method? Is this a reasonable way to approach the problem?

Thank you,

Gale

Dim session As New NotesSession

Dim db As NotesDatabase

Dim collection As NotesDocumentCollection

Dim doc As NotesDocument

Set db = session.CurrentDatabase

searchFormula$ = {Form = “PostSaleDocument” & PMmanager = “Brian.Gray”}

Set collection = db.Search(searchFormula$,Nothing ,0)

Set doc = collection.GetFirstDocument

n = 0

While Not doc Is Nothing

AQCBnum = doc.FieldGetText( "AQCB") 

n= n + 1

   If AQCBnum = "CO0805797" Then

       Msgbox "Found CO0805797"

       End

   End If

Set nextDoc = collection.GetNextDocument(doc)

Set doc = nextDoc

Wend

Msgbox "Docs in collection: " & n

Subject: Delete specific doc using LS

I don’t think you can get the doc in the back end either. If you are an admin just enable Full Access Administration on the server and you will have access to all docs including those where you are not a member of the Readers field. If you are not an admin then have your admin do it.

Subject: RE: Delete specific doc using LS

Thank you Paul… I really appreciate the help.

I will have to contact an administrator and ask for Full Access Administration. I see it listed in the ACL but I can’t change it.

Gale

Subject: Delete specific doc using LS

hi, i dont know weather you have right access to the documents…i you have right access…getting value of backend document is like this…

AQCBnum=doc.getitemvalue(“AQCB”)(0)

i hope this will help you…bye

Subject: RE: Delete specific doc using LS

Jaggu,

Thank you, that will be very helpful. I tried getting Full Admin Access but I can’t find anyone in the company who has it or can grant it… scary. So I am still stuck and I will try your suggestion.

Thanks again,

Gale

Subject: RE: Delete specific doc using LS

Hi,

Should be very carefull with readers field while uodating its very hard to recover the document. For the backend document u can’t use front end class method even though it wont through syntax error but it wont return anything. if you debug then it throws type mismatch. As jaggu suggested use

AQCBnum = doc.AQCB(0)

Make sure use any one [ADMIN] role to update author/reader field so that if reader field misses then using [ADMIN] role you can recover the document. this is the best practice. FYI… as of my knowledge you cant get full administration rights.

cheers