Silly but it works for agent UI interaction

I’ve been trying to create an agent that would infact interact with the front end UI… however every time I tried an @Command to refresh it choked up an error such as “@commands and other UI functions are not allowed in this context”

However… the following scheduled local agent works to refresh the UI without user interaction…

Sub Initialize

Dim s As New NotesSession

Dim db As NotesDatabase

Dim agent As NotesAgent

Set db = s.CurrentDatabase

Set agent = db.GetAgent("updatetodos")



Dim b As Integer



'silly but heck it works!

If agent.Run = 0 Then

	b=1

Else

	b=1

End If



Dim ws As New NotesUiWorkspace

Call ws.ViewRefresh

End Sub

Here’s what updatetodos looks like…

@If(fupDate<=@Today;

@Do(

@SetField(“fupDate”;“”);

@SetField(“Current”;“Yes”);

@SetField(“Stalled”;“No”)

)

;“”);

SELECT @All