Is it possibile to pass a document or a session to java class from lotusscript using LS2J ?
I want to use a java class for update the document. Can i access at document.
Thank you.
Is it possibile to pass a document or a session to java class from lotusscript using LS2J ?
I want to use a java class for update the document. Can i access at document.
Thank you.
Subject: Pass Document or Session with LS2J
Passing a NotesDocument (LS) object to a Java method won’t work, but you could pass, for example, the parent database’s server & replica ID as arguments one and two and the document’s UNID as a third argument. Then your Java code would have enough information to re-access the document (probably not a terribly efficient approach though). Is there some reason you need to use LS2J? Why can’t you write it all in Java?dgg
Subject: What you can do is code your Java in an Agent…
and call it from LS with a NotesAgent.Run(doc.NoteID). You retrieve it in Java with the ParameterDocID. Session session = getSession();
AgentContext agentContext = session.getAgentContext();
// (Your code goes here)
Database db = agentContext.getCurrentDatabase();
Agent agent = agentContext.getCurrentAgent();
// Get document used for passing data
Document doc = db.getDocumentByID(agent.getParameterDocID());