Romil Handoo
Romil Handoo

Reputation: 29

XPages error while copying NotesRichTextItem to other document

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

Upvotes: 0

Views: 249

Answers (1)

Knut Herrmann
Knut Herrmann

Reputation: 30960

It is just a typo. This should work:

rtChild.appendRTItem(rt_Parent)

Upvotes: 1

Related Questions