A very beginner question…I have a form with some fields. When my XPage loads, it should run a Java agent which replaceItemValue the fields in the form with data (all in same database). How do I run the Java agent in XPages to fill my fields with data?
Any hints as keywords to google furthre would help me a lot… Thank you.
…
Well, I need to clarify my question. I can run a Java agent by in my XPage “Event tab” and “beforePageLoad” add “Simple Actions”:
database.getAgent(“MyJavaAgent”).run();
or
database.getAgent(“MyJavaAgent”).runOnServer();
But the problem is that in the Java agent when I do
AgentContext ac = session.getAgentContext();
doc = ac.getDocumentContext();
System.out.println(doc);
The “doc” is null. What is the right approach here?