WebQuerySave & QuerySave both using the same JAVA agent

Hi all.

I need write an agent in JAVA because i use a class with JDBC and i can’t use LOTUS SCRIPT.

I create an agent and call it from WEBQUERYSAVE and from QUERYSAVE because it must run on both client.

This is part of the agent:

Session session = getSession();

AgentContext agentContext = session.getAgentContext();

PrintWriter pw = null;

boolean novodoc = true;

Database db = agentContext.getCurrentDatabase();

Document doc =agentContext.getDocumentContext();

dAtribuicao = doc.getItemValueString(“cpAltDescAtribuicao”);

if (dAtribuicao.equals(“”)){

msguser =“”;

pw.println(msguser);

           }

else

{…

The PRINTWRITER didn’t work on client and on web!!!

What i need use to validate field and/or show error message to user on java agent???

Any help is welcome!

Thanks and sorry for my english.

Daniela

Subject: WebQuerySave & QuerySave both using the same JAVA agent

Hi,

Your printwriter needs be assign to getAgentOutput(). e.g.

PrintWriter pw = getAgentOutput();

This works fine for browser validation.

You may have some problems with using Java to validate form in the Notes client. You can call the Java agent from LotusScript, and tell it to run locally, rather than on the server. But the output from System.out.println will go to the Java Debug Console rather then the client UI. I’m not a Java expert so maybe someone knows has a way of doing this ?

Regards

Ethann Castell

Caliton Innovations

www.caliton.com

Subject: WebQuerySave & QuerySave both using the same JAVA agent

you can use lotusscript, you get lotusscript to call the java code via LS2J