Hi all. I´m again with a very complex cuestion. “Please” help me.
I´ve a web agent (A), triggered in the WebQueryOpen event on my form (F).
This agent (A) perform an action and return a value (V) on a field (I) in the context document (D).
This is the code:
Sub Initialize
Dim doc As notesdocument
Dim session As New notessession
Dim XMLList() As String,x As Variant, i As Integer
Dim xmlapp As Variant,sourceFile As Variant
Set doc = session.DocumentContext
sourceFile = "http://xxx/yyy.asmx/Function?sP=AAA"
Set xmlapp = CreateObject("Microsoft.XMLDOM")
xmlapp.async = False
xmlapp.load(sourceFile)
Set x = xmlapp.getElementsByTagName("short")
Redim XMLList(1 To x.length)
For i = 1 To x.length
XMLList(i)=(x.item(i-1).text)
Next
doc.retval = XMLList(1)
Exit Sub
End Sub
The problem is that after the execution, the field “retval” in the document has no values.
This functions works OK in the NotesClient.
Some ideas that can help me? Please, is very important.
Subject: RE: Agent and OLE Object: Serious Problem
Well, I guess you need to see if the value is even getting set… when run on the server, msgbox statements in an agent output to the console - add some to the agent to see if the value even gets computed correctly.
xmlapp.load(param) needs to use the Call keyword. If you don’t use Call, you can’t use parentheses around the method’s arguments if the result is unassigned.