i would like to create a response doc. Using lotus script how can i get the value of a field from the parent document and assign it to a field in the response document.
both are in the same database.
thanks in advance.
i would like to create a response doc. Using lotus script how can i get the value of a field from the parent document and assign it to a field in the response document.
both are in the same database.
thanks in advance.
Subject: Response Doc
Something along the lines of the following, although it depends how you’re using the parent doc. I’ll assume that it’s the open window.
Dim ws as new notesuiworkspace
DIm uidoc as notesuidocument
Dim s as new notessession
Dim db as notesdatabase
DIm doc as notesdocument
DIm resp as notesdocument
set uidoc = ws.currentdocument
set doc = uidoc.document
set db = s.currentDatabase
set resp = db.createDocument
resp. = doc.
call resp.makeResponse(doc)
call resp.save(true, true)
and that’s it, but obviously replace with the name of the field in the two docs.
HTH
Kiers
Subject: RE: Response Doc
thanks.
since i still have editable fields in the response doc, how would i able to input data on it before saving the response doc?
Subject: Do you have to use script?
On of the coolest things about Notes development is that is has core functionality for Document - Response hierarchies built in. (at the form and view levels) You don’t need to code much at all. Just make your sure you forms are of type “Document” and “Response” and then on the second tab tell the response form how you want it to inherit the values. That means if you have a document with a field subject, and you create a response document to that where the response form also has a field “subject” the value will be filled in for you. Take a look at the design of the Discussion Forum DB for examples of this.
Subject: RE: Do you have to use script?
i already tried using formula language and inherit values and it works.
is it possible yo use lotusscript for response documents and be able to edit other fields before saving?
Subject: Response Doc
let’s say that :db holds the current database
response holds the responsedocument
main will hold the parent document
’ Be sure the response doc is saved
set main=db.GetDocumentByUnid(response.ParentDocumentUNID)
response.AnyFieldName=main.AnyFieldName
…
’ Save the response doc again to keep the new field values
Important Notice: You can only use this method after the responsedoc is saved!