Question : Copy & paste document in a view

Dear All, I need help

1) I need to copy and paste a document in views for form=CAR, after copy I need to modify 3 fields in the new created record.
field b: should contain the value of field a
field a: should contain a new value

field c: should contain the doclink parent of the original document.

I had no problem just creating a button
@Command( [EditCopy] ) ;
@Command( [EditPaste] )
@SetField("b";a)
@SetField("a";mynewvalue);

but I couldn't find a way to create the doclink to the original document.

2) The LN application has like 30 views, only 20 for form=CAR
how do I implement this code in a general way for the 20 views without modifying the 20 views.
all other views should use normal copy & paste.

Thanks and many thanks in advance!

Answer : Copy & paste document in a view

Sorry, you are right.  It needs "set docA = dc.GetNextDocument(docA)" just before the wend.
The loop wasn't the point, though.  The important difference is that it creates a doclink to the original document, without making docB a response.  This is achieved by

dim rti as NotesRichTextItem
...
set rti = new NotesRichTextItem(docB, "CopyOrigin")
call rti.AppendDoclink(docA, "", "")
Random Solutions  
 
programming4us programming4us