Search code examples
xpages

How to get HTML content out of Richtext field of Notesdocument


enter image description hereHi In My Xpages application, I would like to take reference of HTML stored in NotesDocument richtext field( Cofiguration document in Notes Client ), so in Xpages data source I mentioned configDoc as source as Notes Domino Document and in Default Action I set it to " Open Document" and in Document id " I set Computed value as below"

var vw:NotesView = database.getView("vwConfig")
var doc:NotesDocument = vw.getFirstDocument()
var uniid:String = doc.getUniversalID();
 return uniid

In one of the place I placed on computedField property, I mentioned ssjs code as

return configDoc.getValue("RTFIeldasHTML").getHTML();

this works if I open document but does not work if I open existing document and it gives me an error:

Error while executing JavaScript computed expression
docConfig.getValue()' is null

Solution

  • Most likely cause is docConfig doesn't have ignoreRequestParams="true". That means it's opening the document whose ID is in the URL and ignore anything you put in the documentId property. Set that and it will work correctly.