0
votes

I have a Lotus Notes agent that search a database then return the result in Excel format. I got the correct result when I run the Agent using Trigger: On Event -> Action menu selection. But when I schedule to run the agent on the server, I received a different result. There are always 10 documents that keeps showing up on the first 10 rows of the Excel file and I cannot find those 10 documents in the database when I search for them manually in the database.

A few things that are different about the agent that I ran from my PC and from the server:

  1. I have Office 2010 and the server has Office 2003, so the SaveAs method use different parameter

    xlApp.ActiveWorkbook.SaveAs file_Path, 43 'for Office 2003
    
    xlApp.ActiveWorkbook.SaveAs file_Path, 56 'for Office 2010
    
  2. Running the agent from my PC saves the Excel file in my local hard drive. Running the agent from the server saves the Excel file on the path below:

    C:\Windows\SysWOW64\config\systemprofile\Desktop\FileName.xls
    

My search statement:

search_Formula = {Form = "WORec" & SoftDelete != "Y" & WO_Dept="REPAIR" & } & _ 
    {WO_Status != "Completed" & WO_Status != "Declined" & } & _
    {@Like(WOBinNumber; "R%")}

I do not think any of those two differences cause the problem, but I do not know what else to try since I cannot step through the code when it is running on the server. Any help is appreciated.

1
> since I cannot step through the code when it is running on the server - actually, you can. Look into designer help, remote debugger or google for rdebug task.Frantisek Kossuth

1 Answers

2
votes

When you run an agent manually, you run it under the security context of the current user. A scheduled agent runs under the security context of the server.

If there are documents that have reader fields on them, they may only be visible to certain users (i.e. the server, and not you).

You may be able to see these documents if you go to the server and launch Notes on the server itself.