|Professional Services||Second Signal||Presentations||Andrew's Blog||Support|
The document you are attempting to save from your XPage may fail to save when the following conditions are all met:
1. You are using the XPage in a web browser (the issue does not seem to happen in the Notes client)
2. You have selected to computeWithForm "On Save" or "On Both" for the bound document ("On Load" does not seem to manifest the bug)
3. There is a computed field on the form which uses the "@UserAccess" function as part of its formula
Note: You can work around this by testing for @isError() on the result of your @UserAccess call to avoid the formula itself producing an error, however this is not necessary in any other context for the use of the @UserAccess function and so would not be something existing code will be testing for.
I found this after way too much effort. Being fairly new to actually trying to do useful things with XPages, I hadn't added a "Display Errors" design control to my page. Big mistake. I'd have saved a lot of trouble for myself if I'd just done that. Once I did, I saw that the attempt to compute the value at save time was generating the error "@Function may not be used in this context". This error is accurate in that it does represent the cause of the error, however it is inaccurate in that the function should work fine within the web browser context, and always has in the past. For this reason, I consider it a Regression Bug.
Impact on development:
The whole point of having the "ComputeWithForm" option is so that you can quickly take advantage of existing functionality while still using XPages to create a new way of accessing existing applications. This regression bug means that the existing application must be modified in order for the new XPages interface to be successfully used -- or else the entirety of the business logic for the page must be re-created on the XPage itself. Recreating the business logic is time consuming and is prone to creating differences in the result when the XPage is used vs. the traditional application.
In addition, this impacted me directly as I had to spend a couple of days chasing down a problem while trying to get used to working in XPages, instead of actually doing productive work.
Please wait while your document is saved.
coding. Our Notes forms don't have many formulas for field computation, almost
all logic is extracted into Lotusscript libraries. And computeWithForm does
only work with formula language AFAIK. Are there many developers out there
still using formula code that much and no Lotusscript? From my experience, even
if you start small with a few lines of formula language, things soon get more
complicated and the code grows until everything is really messed up (like
calculating calendar weeks in formula). Same with XSLT. Nice for small things,
but with growing requirements you either produce a big mess or throw away
everything and start from scratch in Java or Lotusscript.