Thursday, 15 March 2012

xpages copy field value to another field from other datasource -



xpages copy field value to another field from other datasource -

i followed how re-create datetime field current document new document , seek this:

cdoc.save(); pdoc.copyitem(cdoc.getdocument().getfirstitem("mytest1")); getcomponent('exampledialog').show()

but handling error message.

thanks time!

assuming cdoc , pdoc defined xp:dominodocument info sources have alter code to:

cdoc.save(); pdoc.getdocument().copyitem(cdoc.getdocument().getfirstitem("mytest1")); getcomponent('exampledialog').show()

so, need add together .getdocument() pdoc notes document. otherwise fails , error "error calling method 'copyitem(lotus.domino.local.item)' on object of type 'notesxspdocument'".

keep in mind have save pdoc after copying item if want show copied item in exampledialog.

if don't want save document pdoc @ point yet can re-create item on notesxspdocument level just:

pdoc.replaceitemvalue("mytest1", cdoc.getitemvaluedatetime("mytest1")); getcomponent('exampledialog').show()

xpages

No comments:

Post a Comment