Calling java class from a form

I have an application where the users need to attach a spreadsheet to a document. I have a bunch of java code that needs to parse the spreadsheet and check for any errors. So, what I think I need to do is, when the user clicks a button it opens a dialog for the user to select the file to attach. That part isn’t a problem.

The problem comes in when I have to run the file through a parser to check for issues. I’ll need an agent created that calls the java code to run on the file attachment. The problem is that I don’t know how a java agent that I trigger can get the currently open document. Could someone point me in the right direction?

Thanks,

Steve

Subject: calling java class from a form

Well, besides calling a java function using LS2J and passing document’s Universal ID as parameter, you can create a temporary document containing opened doc’s UniversalID and then call the Java agent with tempdoc’s NoteID as parameter, then read the tempdoc’s field using Java agent and use getDocumentByUnid to get the original doc.You must save the opened document before calling the agent/function, otherwise it will not see the changed which you made in UI.

Subject: Thanks, LS2J should do the trick