Is it possible to run agent(run behalf of) with argument(username for example that trigger the agent )? In action button I want to run agent behalf of administrator, and I need to know inside the agent who trrigger it.
Subject: Agent arguments
It’s all there in designer help: The only parameter you can pass to an agent is a NoteId (using Run() or RunOnServer()).
So, if you want to capture the user name of the person who clicked the action, your action code has to create a temporary document first (does not need to be visible in any view), add the user name to an appropriate field via backend, save that document, pass its NoteId to the agent and probably have the agent delete the temporary document.
Alternatively, you could store the info as an environment variable or in a profiledocument and then read it from the agent code.