Copy Attachment

pts.
Tags:
Development
Lotus Domino
I have two Forms in different database. What I'm going to do is to selected fields in Form A and assigned them to fields in Form B. I have no problem at all to get and return values including the RichTextField items. The problem occurs when I try to attach file or embedded objects by locating them in field "Body"(a richtext type) and want the attached file icon to be displayed in the Form B. I've try seeking the answers from the Domino help..but can't resolve it. So, kindly ask for assistance from you all.

Answer Wiki

Thanks. We'll let you know when a new response is added.

Do you have the target document open when you do the copy? If so you will have to re-open it again in order for the change to appear in the “form”

Do you know if the attachments are associated with the Body richtext item or with the document? If you post the lotusscript code you are using to do the copy, might be able to help.

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • MHanson
    Read up on the append RTITEM method. Dunno what typre of files you are attaching, but mine forks with PDF, WORD and Word Perfect attachments. Here is the code form the help example and also a snippet of the code I use. 1. This script takes the Body item on document B and appends it to the end of the Body item on document A. The Body item on document B is deleted using the Remove method defined in NotesItem. Dim docA As NotesDocument Dim docB As NotesDocument Dim rtitemA As Variant Dim rtitemB As Variant '...set values of docA and docB... Set rtitemA = docA.GetFirstItem( "Body" ) Set rtitemB = docB.GetFirstItem( "Body" ) If ( rtitemA.Type = RICHTEXT And _ rtitemB.Type = RICHTEXT ) Then Call rtitemA.AppendRTItem( rtitemB ) Call rtitemB.Remove Call docA.Save( False, True ) Call docB.Save( False, True ) End If *************************************************** here's my code for creating and passing rich text to another db's form. I left out the declarations, I pass the contents from the Order field in doc in db1 to the Order field in rdoc in db2. I also test to make sure the Order field has Rich Text but I left that statement out for clarity. Set rtitem = doc.GetFirstItem( "Order" ) If ( rtitem.Type = RICHTEXT) Then Set rrtitem = rdoc.CreateRichTextItem( "Order" ) Call rrtitem.AppendRTItem( rtitem ) End If ****** good luck
    35 pointsBadges:
    report
  • Merancang
    Erm.. Here are some of my script been used for the question I asked before. Sub Click(Source As Button) Dim workspace As New Notesuiworkspace Dim uiMail As NotesUiDocument Dim mail1 As Notesdocument Dim doc As NotesUiDocument Dim maildoc As Notesdocument Set uiMail = workspace.CurrentDocument Set mail1 = uiMail.Document Dim rtItemA As Variant Set rtItemA = mail1.GetFirstItem("Body") '====Create Log // 2nd Form==== Set doc = workspace.ComposeDocument("DEVT_SVR/INT_SYS", "MOREMSBISHELP.NSF", "UserLog" ) Set maildoc = doc.Document Dim rtItemB As Variant Set rtItemB = maildoc.GetFirstItem("DetailDescription") If ( rtItemA.Type = RICHTEXT And _ rtItemB.Type = RICHTEXT ) Then Call maildoc.CreateRichTextItem( "DetailDescription" ) Call rtItemB.AppendRTItem( rtitemA ) Call maildoc.Save(False,True) End If End Sub /// Result - There is nothing in the DetailDescription field in the 2nd form __________________________________________________________ Sub Click(Source As Button) Dim workspace As New Notesuiworkspace Dim uiMail As NotesUiDocument Dim mail1 As Notesdocument Dim doc As NotesUiDocument Dim maildoc As Notesdocument Set uiMail = workspace.CurrentDocument Set mail1 = uiMail.Document '====Create Log==== Set doc = workspace.ComposeDocument("DEVT_SVR/INT_SYS", "MOREMSBISHELP.NSF", "UserLog" ) Set maildoc = doc.Document Call doc.FieldAppendText("DetailDescription",mail1.Body) End Sub /// Result - The contents of the field(text) in the 1st form are appeared in the field in the second form..but attachments are not appeared
    0 pointsBadges:
    report
  • CharlesJC
    merancang, Notes does not create RichText fields until the NotesDocument is saved. So, the code in the if-block, in the first set of code, never gets executed. In the second set of code the FieldAppendText method of the NotesUIDocument object only appends text. My suggestion would be to try to get the existing DetailDescription item or create it if it doesn't exist. Then append rtItemA into rtItemB. It should look something like this: Sub Click(Source As Button) Dim workspace As New Notesuiworkspace Dim uiMail As NotesUiDocument Dim mail1 As Notesdocument Dim doc As NotesUiDocument Dim maildoc As Notesdocument Set uiMail = workspace.CurrentDocument Set mail1 = uiMail.Document Dim rtItemA As Variant Set rtItemA = mail1.GetFirstItem("Body") '====Create Log // 2nd Form==== Set doc = workspace.ComposeDocument("DEVT_SVR/INT_SYS", "MOREMSBISHELP.NSF", "UserLog" ) Set maildoc = doc.Document Dim rtItemB As Variant if maildoc.HasItem("DetailDescription") then Set rtItemB = maildoc.GetFirstItem("DetailDescription") else set rtItemB = maildoc.CreateRichTextItem( "DetailDescription" ) endif If ( rtItemA.Type = RICHTEXT And rtItemB.Type = RICHTEXT ) Then Call rtItemB.AppendRTItem( rtitemA ) Call maildoc.Save(False,True) End If End Sub Hope this helps, Charles
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following