This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Sep 6, 2012, 6:32 PM
21 Posts

Doesn't seem to recognize RTI

  • Category: Other
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 2
Hi everyone
 
  I'm getting the following error: 
 
Error saving data source document1
Error while executing JavaScript action expression
Script interpreter error, line=26, col=20: [TypeError] Error calling method 'addNewLine()' on an object of type 'lotus.domino.local.Item [Static Java Interface Wrapper, lotus.domino.local.Item: lotus.domino.Item]'
   at [/Sub-SendEmailRTI.jss].sendEmailRTI(com.ibm.xsp.model.domino.wrapped.DominoDocument@5e3d5e3d)

Here's where it's coming from: 
 
var issueField:NotesRichTextItem = stEntryDoc.getFirstItem("Issue");
issueField.addNewLine();
 
What I'm doing is grabbing the contents of a richText field and emailing the content.  That's working ok.  Now I want to add some additional text to the email before sending it out so I need to be able to modify the field.
 
The error seems to be implying that trying to call addNewLine() from a NotesItem.  I clearly cast it as a NotesRichTextItem.  Or am I misreading the error?
 
thanks 
clem 
Sep 6, 2012, 9:58 PM
366 Posts
Re: Doesn't seem to recognize RTI
 Your not really casting as a NotesRichTextItem as the cast has to go on the right side of the statement.
 
The getFirstItem method returns a notes item object and even though the variable is declared as a RTI the object returned is not. 
 
You can either just manipulate the text of the item or create a java class (where you would be able to cast it correctly) and do you manipulation there. 
 
 
Sep 10, 2012, 4:00 PM
21 Posts
Re: Doesn't seem to recognize RTI
  Thanks for the reply.  Re: casting, I was assuming it worked like java.  Well, the java I remember playing with like 10+ years ago.  I may be 'misremembering' but I thought to cast a variable in java, you something like "var x(field type) = <something>. I just thought maybe it worked like that.
 
  But I did finally figured out how to do what I've been trying to do.  It's about grabbing the content of a RT field and prefixing and postfixing some text that then becomes an email.  Turns out it's pretty simple, actually. Here's what I did:
 
"Issue" is the RTI and stDocument is a NotesXspDocument.

var replyContent = stDocument.getItemValueString("Issue");

var rtiIssueField = maildoc.createRichTextItem("body");
rtiIssueField.appendText("**IMPORTANT: blah... **");
rtiIssueField.appendText("\n<LWST>");
rtiIssueField.appendText("\n"+replyContent);
rtiIssueField.appendText("\n</LWST>")

maildoc.send();
 
There's an issue with the MIME conversion.  But hopefully I can figure that out.
clem 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal