Subject: agent.save on manual agent does not change owner
Try changing something unimportant about the agent programatically, such as enable/disable status and then save. It maybe that it tries to be too smart and does not save because nothing changed.
Subject: RE: agent.save on manual agent does not change owner
Did you ever figure this out, I’m tring to remove the (editofficeprofile) agent to recreate and I’m seeing the same issue. Can’t remove an agent that dosen’t belong to me and ag.save() isn’t signing the agent.
Subject: RE: agent.save on manual agent does not change owner
You have to set a property of the agent, like agent.Server, and then save it. But you also need a new NotesSession to recognize the new signer, so you have to call another agent to do the actual remove.
Subject: agent.save on manual agent does not change owner
How do you know the signiture is not being changed? Are you looking at the signiture value in the properties box or are you looking at the Designer display? The Designer does not show you the signer, it shows you the value of the person who last updated the document. There is a tip about this in the Agent FAQ that bailed me out once.
Subject: RE: agent.save on manual agent does not change owner
The two read/write properties are Server name and enable/disable status. I assumed you tried both an both fail because it is a menu agent? I wrote the developer about this situation, but in the short term maybe there is another way to get this done.
There is a new method that signs elements in the database, that will do what you want in a slightly different way.
Why do you need to change signiture to delete it? Are you trying to use AdminP to do the deletions? You could delete the agent programatically yourself if you have proper access.
Subject: RE: agent.save on manual agent does not change owner
Julie
Thanks again for following this thread. I have been away and I am now looking into it again. I was able to change the agent’s signer using the agent.Server value, even though it does not apply to menu-driven agents. This is good news.
Now that I have signed it, I need to delete it. But I have found this in the help:
Saving the agent changes the owner immediately. However, if you subsequently get the owner within the same NotesSession, the previous owner’s name is returned. The ownership change is not reflected in the properties until the next time a Session is obtained.
A script has only one Domino session, so successive calls to the New method return the same session handle.
So I have to call another agent to get a new NotesSession handle to delete the agent?
I want to delete the agent so I can install a new version of it. It is part of an uninstall/re-install function that will be used outside my domain.
Subject: RE: agent.save on manual agent does not change owner
Are you trying to do these modification to the agent you are currently running?The agents cannot perform operations on themselves - like enabling themselves and then saving. It generates problems similar to replications problems (except you don’t see them because they are design documents). We (Domino framework) make all kinds of modifications to the agent (like updating agent log, saving the info when the agent run last, what documents it processed) and if the agent tries to make modifications to itself there is a conflict.
The information in the session about the current agent is cached (reading it from disk every time we need some information would slow things down quite a bit).
It would work better if you use another agent to perform operations on your agent.
Subject: RE: agent.save on manual agent does not change owner
I am running 1 agent to install/un-install multiple agents. The un-install agent loops through a set of agents within the database and removes each one. Once they are removed, the same agent then calls a function to re-install them. I ran into a problem when 1 of the agents I was trying to remove gave me the error about not being able to remove agents not belonging to me. Now I have that resolved (by setting agent.Server and saving it), but I need a new NotesSession to recognize the new agent owner (me)…which requires another agent… am I right?