This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Jan 25, 2013, 4:30 AM
27 Posts

How do I access "session.DocumentContext" with in an XPage with SSJS?

  • Category: Server Side JavaScript
  • Platform: Not Applicable
  • Release: 8.5.3
  • Role: Developer
  • Tags: session DocumentContext SSJS
  • Replies: 1
Please forgive this newbie question, but I have a LotusScript agent called "MyAgent" that sets a value like so:

Set context = session.DocumentContext
context.myLinks = "SOME DATA"

...and then I invoke the agent from the XPage like so:

var agent = database.getAgent("MyAgent"); 
agent.runWithDocumentContext(mydoc.getDocument());

(...where <xp:dominoDocument var="mydoc"...)

How do I access the "myLinks" field in the XPage? ...what is the syntax/object I should be using? I've tried something like:

<xp:text escape="false" id="computedField6"
value="#{javascript:mydoc.getItemValue('issueLinks');}">
</xp:text>

...but this does not work.

Any help/advice is greatly appreciated!
Thanks,

a

Jan 25, 2013, 5:42 PM
27 Posts
SOLUTION FOUND: How do I access "session.DocumentContext" with in an XPage with SSJS?
This one was tricky!  It is essential to check the "Run as Web user" checkbox in the "Security" tab of the LotusScript agent, otherwise you will get strange exceptions thrown (in my case it was a "TypeError" exception).  I figured it out by looking at this very helpful blog post:

http://www.zarazaga.net/web/z.nsf/dx/notesagent.runwithdocumentcontext-behaviour

It would be great if IBM could include this in their reference documentation.

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal