DBlookup not working in scheduled agent on server

I've written a scheduled agent that does a dblookup to another database on the server.  The agent doesn't pull anything from the lookup when run as a scheduled agent.  

If I copy the code into a menu agent and run it, it runs fine.  And it emails me the dblookup variables it pulls.

I know the agent is running on schedule because it makes changes to the documents before it gets to the dblookup section.  But it won't run the dblookup.  But a field that it supposed to populate from the dblookup has the followinge error: "you are not authorized to perform that operation."

I have the same issue on the server.

I have a copy of the lookup database on the server and on my local.

I am running 5.12 on workstation and server.

Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

DarthModConnect With a Mentor Commented:
PAQed with points (500) refunded

Community Support Moderator
Sjef BosmanGroupware ConsultantCommented:
- there must be something in the log-database of the server( error messages etc)
- what permissions do you have (you saved the agent?) on the server to run agents?
- let's have some code please...
Is your @DbLookup pointing to external Notes database (Another Domino server?)

Is the DbLookup data in your same server and same database or another database?
mackmcraeAuthor Commented:
I figured it out.

The dblookup was pulling back a null value sometimes (it was a list of shift supervisors and one shift didn't have a supervisor.  Something I didn't know was possible.).

From what I can tell, when an agent is run from the menu in a view, it runs through each document one at a time.  So when the agent got the null value and tried to operate on it, it got an error and moved on to the next document.

However, when the same code is run in a scheduled agent, it works differently.  When it gets the same error, it just bombs and doesn't correctly move on to the next document.

No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
    PAQ with points refunded

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

EE Cleanup Volunteer
All Courses

From novice to tech pro — start learning today.