Hi:
I need help. I am trying to update a view through a scheduled agent after an import is run, but it is not working. Is this possible, or am I doing something wrong?
Scenario:
I have a process that imports data into the system onto a form. On this form one of the fields is using a @DBlookup. After the import is complete, in a separate agent, I want to do a refresh/update to the form so the @dblookup calculates and saves.
Manually, if I do a select all on a view and then run an action agent that does
@Command([ToolsRefreshSelectedDocs]);
@All;
@All
This works. But I do not want to have the manual interaction, I want this to be done through a scheduled agent.
I tried .computewithform and this runs the @dblookup because it returns the error message that I have on the field but it does not populate the data. If I open the form through my view, put it in edit mode and press F9, this runs the @dblookup and populates correctly as well.
This is the formula on the form - Text - computed.
key := iSystem_Typ_Key ;
view := “luSystemTypes.KEY” ;
errmsg := “Not Found” ;
v := @DbLookup( “”; “” ; luSystemTypes.KEY ; iSystem_Typ_Key ; 2 ) ;
this is the agent that I am trying to use to update it, but that is not working.
Dim session As New NotesSession
Dim ws As New NotesUIWorkspace
Dim currDb As NotesDatabase
Dim rowView As NotesView
Dim dc As NotesDocumentCollection
Dim currDoc As NotesDocument, nextDoc As NotesDocument
Set currDb = session.CurrentDatabase
Set rowView = currDb.GetView("luSystem_Mstr.SysTypeName")
Set currDoc = rowView.GetFirstDocument
Do Until currDoc Is Nothing
Call currDoc.ComputeWithForm(False,False)
Call currDoc.save(True,False)
Set currDoc=rowView.GetNextDocument( currDoc )
Loop