This short article shows you how to resolve the error “The agent must be run from a view window”.
When you right click an Agent in Lotus Notes Designer then follow by Run Agent.
The error pop up like the one below.
In this case how are you going to debug the code.
Go to Tools and click Debug LotusScript.
1. Leave the Lotus Notes Designer.
2. Go to your Lotus Notes Client.
3. Open the Database you want to debug.
4. Run the Agent in one of the View there in for example, ExportAttachment.