Script error in view

Hi All,

the error is illegal use of property.

have written a script on action button for view.There is a document which is locked by DocStatus field “Locked”.In view i have to unlock the lock document. Here is my code

Dim session As New NotesSession

Dim ws As New NotesUIWorkspace

Dim uiview As NotesUIView

Dim db As NotesDatabase

Dim coll As NotesDocumentCollection

Dim doc As NotesDocument

Dim history1 As String

Dim answer As Integer

Set uiview = ws.CurrentView

Set db = session.CurrentDatabase

Set coll = db.UnprocessedDocuments

If coll.Count <> 1 Then

Msgbox “Please select only one document to lock it”

Exit Sub

End If

Set doc = coll.GetFirstDocument

            answer = Msgbox("Are sure, that you want to lock this document for further editing",4+32,"International Certification Library")

If answer = 6 Then

history1 = "Document has been unlocked by " & session.CommonUserName & " on " & Date$

          If doc.DocStatus(0) = "Locked" Then  

Call doc.FieldSetText(“DocStatus”,“0”)

doc.History = doc.History(0) +Chr(13) + history1

Call doc.save(True,False)

Call uiview.View.Refresh

Call ws.ViewRefresh

End If

End If

Subject: script error in view

Hi Rajeev, In This Code u r setting the db. Like

Dim session As New NotesSession

Dim db As NotesDatabase

Set db = session.CurrentDatabase

Use This

Subject: Check The Agent Properties

Hi Rajeev, Please Check the Agent Properties.

In Second Tab Of Agent

Click on.

Allow Restricted Operation.

After this start the debugger. and debug the code.

And Tell me which line its shows error…

Subject: script error in view

Hi pawan ,

the error is

Illef=gal use of property

Subject: script error in view

Dear rajeev ,

sorry i was busy, first u decide that r u working for backend documents or fron end documents. U used Fieldset property of front end classes without setting its object . how its possible . make a object first , intialize it then use

RIshi

Subject: script error in view

The method “FieldSetText” applies to uidocs only. So change Call doc.FieldSetText(“DocStatus”,“0”)

to

doc.DocStatus = 0

or

doc.DocStatus = “0”

depending on the fieldtype of “DocStatus”

axel

Subject: RE: script error in view

Hi Axel,Pawan,

Your responce work.Thank.

I am missing on call .uidoc …here is mistake.u r right Axel.

Lots a thanx