XPages NotesRichTextItem copy error

By Romil Handoo

In one of my XPages, I have written the following code to copy the content of one rich text item into another. Both rich text items are within different documents.

var docChild : NotesDocument = database.createDocument();
docChild.replaceItemValue(“Form”, “Child”);
var rt_Parent : NotesRichTextItem = docParent.getDocument().getFirstItem(“Body_1”);
var rt_Child : NotesRichTextItem = docChild.createRichTextItem(“Body”);
rtChild.appendRTItem(rtParent)

Here docParent is the document associated with current XPage (as data source). When trying to execute the code, I am getting the following error:

Method NotesRichTextItem.appendRTItem(lotus.domino.local.Item) not found, or illegal parameters

Someone guide me how to fix the issue, and what is the proper way to copy an RT item from one document to another (field name of RT item is different in source and destination documents).

Thanks
Romil

Source: Stack Overflow

    

Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273