How to refresh a view with a @dblookup in it through an agent

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

Subject: How to refresh a view with a @dblookup in it through an agent

I think you need to adjust this:

key := iSystem_Typ_Key ;

view := “luSystemTypes.KEY” ;

errmsg := “Not Found” ;

v := @DbLookup( “”; “” ; luSystemTypes.KEY ; iSystem_Typ_Key ; 2 ) ;

to this:

key := iSystem_Typ_Key ;

view := “luSystemTypes.KEY” ;

errmsg := “Not Found” ;

v := @DbLookup( “”; “” ; view ; key ; 2 ) ;

Subject: RE: How to refresh a view with a @dblookup in it through an agent

I am sorry I was playing with the code in a different location. this is what it looks like on the form… It is the way you said above.

key := iSystem_Typ_Key ;

view := “luSystemTypes.KEY” ;

errmsg := “Not Found” ;

v := @DbLookup( “”; “” ; view ; key ; 2 ) ;

@If ( @IsError(v); errmsg ; v )

Subject: RE: How to refresh a view with a @dblookup in it through an agent

Is iSystem_Typ_Key a computed for display field? Or if Computed, would, the value change depending on who the “current user” is? Lastly, any reader fields on the documents that you expect to appear in the view?

Subject: RE: How to refresh a view with a @dblookup in it through an agent

It is not a computed field it is Text - Editable. The value would not change per user, and no there are no reader fields.