I have question regarding session.evaluate in SSJS. In a keyword document I have some @formula stored which does some conversion of data. Lets say this is would be:
@left(fieldname;2)
If the fieldname contained 'hello' this would result in 'he'. Nothing to fancy here. Now I would like to use this in an xpage.
I wrote a function called executeFormula(doc). I call this function from an action on a xpage. This xpage contains 1 notes document datasource. The function call is
executeFormula(datasource.getDocument(true))
Now for some reason the @formula is never calculated correctly. Do I need to save the document first before I can use session.evaluate(kwFormula,doc)
or is the @formula wrong in some way?
p.s. I forgot to mention that this code is working inside a customvalidator