Object Variable not set

Hi! all,

I am getting an error “Onject variable not set”. Please help me if some body can…

What i have I have an embeded view which has a column which get populate using HTML
Code

“{<input type=checkbox name=processdocs value=” + @Text(@DocumentUniqueID)

  • " />]"

this views property set to treat view content as html

I have also added a button which call an agent which do additional taks
what i worte there is:-

Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim context As NotesDocument
Dim process As NotesDocument
Dim item As NotesItem
Dim value As String
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set view = db.GetView(“ReceivedResume”)
Set context = session.DocumentContext
Set item = context.GetFirstItem(“processdocs”)
Msgbox “hello”
Forall v In item.values
Msgbox v
Set process = db.GetDocumentByUNID ( v )
end forall

while calling agent i get “Object variable not set”
where as message Hello get prompt.
It means error is in my line

“Forall v In item.values”

can any one rectify my problem… where actually problem is…
Please help…

With Regards,
Vikas K Sinha

Subject: Object Variable not set

HI Vikas,The error you are getting at this point

“Set item = context.GetFirstItem(“processdocs”)”

Processdoc is declared as notes doucment but not set any where.

Please do set the Processdoc to get the first doc form the viewor what is required as per the requirement and try clicking on the button.

The best way to analyse the error is to run the debugger befor click on the button

Thanks & Regards

Sruthi

Subject: RE: Object Variable not set

Thanks All for your prompt response.

But friend I have never declare processdocs as notesdocument

As you see my code I have declare process as notesdocument.

and I named processdocs of my check box which i use to create using HTML

“td width=5% align=center><input type=checkbox name=chk1 value=” + @Text(@DocumentUniqueID)

  • " />]"

I will be very thankful to you for you reply…

Hi! Mike you to thanks for your resposen

when I used

If (item Is Nothing) Then
Msgbox “iteem not found”
End If

it prompt “iteem not found”…
My questing is why… as you see my view has column which get populated above html
code. then why it doesn’t get recognized
Is there any setting need to be done in my “$$ViewTemplate for myView” Form.

One more questing when I am putting field on this form it will not be visible. Let
say I put field type text then it will not viewable to me… why?

Please help! Masters…

With Regards,
Vikas K Sinha

Subject: Object Variable not set

Hi Vikas,

DocumentContext when you call an agent directly does not return the current document:

For an agent run from a browser with the OpenAgent URL command, the in-memory document is a new document containing an item for each CGI (Common Gateway Interface) variable supported by Domino. Each item has the name and current value of a supported CGI variable. (No design work on your part is needed; the CGI variables are available automatically.)

What you can do is pass the field value of processdocs as arguments to the agent and parse them in the agent. Disadvantage: if you have a lot of documents selected you’ll get an extreme long (and maybe too long) url.

Another option is to submit the document if you press the button and start the agent as webquerysave agent. In that case you can use documentcontext to get a handle to the current document.

If you don’t want the document to be stored in the database, you can use the saveoptions field.

Regards,

René

Subject: Object Variable not set

You need to check if item exists

If (Not item is Nothing) then

End If