Solved

Creating Response Document Using LotusScript

Posted on 2003-11-13
7
1,078 Views
Last Modified: 2013-12-18
I'm fairly new to notes and still getting used to the syntax.
So I need help with the following:

I have a form and a response form(they are identical).

I want a button on my parent form which when clicked creates a response
document with the parent documents values it and opens the the
parent document in edit mode.

This is what I want the code to look like:

Dim workspace As New NotesUIWorkspace
===============================================
This is where I need the code that creates the
child form sets its values and it
Note: Code here will only set up the values for the child document.
         A different button will actually save the response document.
         So some sort of Global variables need to be used
===============================================
Call workspace.EditDocument( True )
Dim uidoc As NotesUIDocument
Set uidoc = workspace.CurrentDocument

Thanks.......
0
Comment
Question by:marefin
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 31

Expert Comment

by:qwaletee
ID: 9743471
Hi marefin,
> when clicked creates a response
> document with the parent documents values it and opens the the
> parent document in edit mode.

Your description seems like it has a piece missing.  What do you want to do with this response?  It sounds like you want to create the respnse in teh background but never show it, and then allow the user to edit the main.

Sounds like you might want to just use the built-in versioning feature.

Best regards,
qwaletee
0
 
LVL 5

Expert Comment

by:apparition
ID: 9743537
Actually what I'm trying to do is Have a button on the
Parent form that says "Create new version"
What this will do is allow the user to edit the document
but save the exhisting data in another document as a response.
So every time the user clicks on the button a new version is created
while the older one becomes a response.

I don't know much about built in version controlling, if doing it that
way accomplishes what I want to do the I all for it.

Please provide feedback.
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9743548
Well Qwaletee has a point if you are intended to do something like that.

But if you are talking about two different forms then go for script.

Anyway Are you planning to copy all the fields into the child ?

Dim session as New NotesSession
dim db as NotesDatabase
dim child as NotesDocument

set note = uidoc.Document  ' uidoc should be set

set db = session.CurrentDatabase
set child = New NotesDocument(db)
call note.CopyAllItems( child, true )  ' If you are planning to do selective copy then do this child.Field1 = note.Field1
child.Form = "Child Form Name"

child.save true, false

~Hemanth

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 24

Assisted Solution

by:HemanthaKumar
HemanthaKumar earned 25 total points
ID: 9743561
Well then versioning is something that you might want to take a look at. Here is the help documentation describing how to enable versioning

http://www-12.lotus.com/ldd/doc/domino_notes/5.0/help5_designer.nsf/078c27b23262ffff852566dd0029426a/4248ab357568780f8525672f007a0dd9?OpenDocument
0
 
LVL 31

Accepted Solution

by:
qwaletee earned 100 total points
ID: 9744158
apparition,
In FORM PROPERTIES, on the first tab, there is a "versioning" section.  You want the option "Prior versions becomes responses."  that's al yu have to do.  No second form, no buttons, nothing.  If anyone saves the document using a Notes client, Notes will, before saving the new version, copy the old version to a new response document.
0
 

Author Comment

by:marefin
ID: 9747954
guys,

I am using notes built in Version Control as you suggested but I'm running into one problem. If I chose to edit the document
it also saves it as a newer version. In my application theres to buttons one is "Create new version" and the other is "Edit".
The function of edit being ability to edit the document not save the prior version as a response, only clicking on create new version
will save prior version as response.

Any thoughts?
0
 

Author Comment

by:marefin
ID: 9748300
Got it I'm using
uidoc.SaveNewVersion
or
uidoc.SaveNew

Depending on which button is clicked

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now