View is not refreshed by progrraming

Hi All,

I have one view where my schedule agent run and from this agent i have removed document which are processed but from 10 days i have facing problem that document is processed but document not removed from view when i just refresh manually then document removed otherwise agent was stuck i have not able to understand what is the solution for this

My Code is

Set AlertVw = Alertdb.GetView(“vwUpdAlerts”)

AlertVw.AutoUpdate = False

Set Alertentrycoll = AlertVw.AllEntries

If Alertentrycoll.Count > 0 Then

For i = 1 To Alertentrycoll.Count

		Set Alertentry = Alertentrycoll.GetNthEntry(i)

		If Alertentry.IsValid Then

Set Alertdoc = Alertentry.Document

Alertdoc.AlertUpdFlag=“Y”

			Call Alertdoc.save(True,False)

Next

end if

AlertVw.AutoUpdate = True

Call AlertVw.Refresh

Here i have called Refresh after Loop but in my program not en because my document is not removed from view so that program going to be nested loop not come up out of loop .

Subject: You are updating the view in the backend

To see the view update in the client, you will need to use the NotesUIWorkspace classes.

Subject: RE: You are updating the view in the backend

But my agent is schedule agent run in backed so how i use notes UIworkplace