I have some issue while retrieving data from the back end document. The back
end document contains two fields. First field is version name which is a text
field and second field is version details which is a rich text field. In the
front end document if i enter the version name it will automatically retrieve
the attachment from back end documnet and places it in the corresponding field
in the cuurent document.
If the second field is text field then we are able to
retrieving the values from backend document. But in case of richtext field only
we are unable to retrieve the value. The attachment size in the rich text field
is in MB's. The richtext field value is not listed in the view column.
I used lotusscript code to extract the file to local hard disk.
But after extracting the file i am unable to attach that file to corresponding
field in the front end document. Below code is used to extract the file from
backend document to local harddisk drive.
Dim ws As New NotesSession Dim db As NotesDatabase Dim view As
NotesView Dim doc As NotesDocument Dim rtitem As
NotesRichTextItem Dim object As NotesEmbeddedObject
Set db =
ws.CurrentDatabase Set view = db.GetView("viewname") Set doc =
view.GetFirstDocument Set rtitem = doc.GetFirstItem( "fieldname"
If ( rtitem.Type = RICHTEXT ) Then Forall o In
rtitem.EmbeddedObjects If ( o.Type = EMBED_ATTACHMENT ) Then Call
o.ExtractFile( "D:" & o.Source )
Call doc.Save( False, True
) End If
End Forall End If
By using above code we are extract the file to local hard disk
drive. After this we are unable to attach file to the current document. The
above code was written in the Field Existing event.
For file attachment i used the below formula language code.
Above mentioned codes working fine while executing them seperately.The
main issue is we are unable to execute both the codes same time. The file
extract code is in Script launguage and file attachment code is in formula