I am trying to customize Lotus Notes form by calling a agent on document submit. How do I pass the document id of the current document(new calendar item/new mail etc) to the java agent?Can this be done using javascript?
First of all, you can set up an agent to run automatically on all new and modified documents in a database. If you do that, then you don't have to pass anything, as the agent will get a reference to the new/modified document via the NotesDocument.UnprocessedDocuments property.
But secondly, if you're using the Javascript NotesAgent.runOnServer() method to run your agent, that method takes a noteid as an argument. You can access the noteid via the NotesDocument.getNoteID() method and just pass it as the argument.