Aug 8, 2016, 11:49 AM
453 Posts

I'm with David

  • Category: Server Side JavaScript
  • Platform: Windows
  • Release: 9.0.1
  • Role: Developer
  • Tags: xpage agent
  • Replies: 5

If in doubt print something to the server console. During development I do a lot of that. I think that as Dave points out it is probably the var statement. 

I have a fair bit of LotusScript code that I run as background agent, and that works well,however, I never use them to return information. Write a SSJS code or a Java auction. 

The other day I was doing some experimenting on some SSJS code I have been using to open a document in a custom control. I was passing a form name and I had to relate it to a control to open. In my test I got the start time in milliseconds and the time from the before page loads. This process took about 75 milliseconds. I created a viewscope java bean (I do everything from a single XPage so l'm almost always in the same view). Now that same process take 6 milliseconds! Now the 75 milliseconds load time is hardly noticeable but it clearly demonstrate the concept. From LS to SSJS would no doubt be significantly faster, then to Java a further step up.


Aug 8, 2016, 1:06 PM
298 Posts
Use the Debug Toolbar
The debug toolbar lets you print messages to a toolbar on top of your XPage, inspect scoped variables, view the components on a page and their methods, and more.

Bill, it can even do timing (there is an option to show the times in ms).

When I develop it is the first thing added to the design and I don't turn it off until I start acceptence testing.