Solved

Problem with carry forward

Posted on 2004-09-08
4
206 Views
Last Modified: 2013-12-18
Thought I had this figured out but when the user clicks the submit button it is not closing and saving the doc. How can I have it close and save and open the new doc. It ended up behind a second doc. The user then gets prompted to save and may get confused.

Also, this is a simple thing but I don't use script that much. How can I do a SetField in script. I need a status field to update to submitted when they click the Save and complete next button.

Sub Click(Source As Button)
      Dim sess As New NotesSession
      Dim ws As New NotesUIWorkspace
      Dim db As NotesDatabase
      Dim uidoc As NotesUIDocument
      
      Dim doc, newdoc As NotesDocument
      
      Set uidoc=ws.CurrentDocument
      Set db = sess.CurrentDatabase
      Set doc= uidoc.Document
      
      
      Set newdoc = db.CreateDocument
      
      newdoc.Form = "ibpc_order_form"
      newdoc.contact = doc.contact
      newdoc.zone = doc.zone
      newdoc.address = doc.address
      newdoc.address2 = doc.address2
      newdoc.city = doc.city
      newdoc.state = doc.state
      newdoc.zip = doc.zip
      newdoc.phone = doc.phone
      newdoc.ccc = doc.ccc
      
      Call newdoc.save(True, False)
      
      ws.EditDocument True, newdoc
End Sub
0
Comment
Question by:jforget1
  • 2
4 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12010366
before ws.editdocument command

paste this

uidoc.save
uidoc.close

~Hemanth
0
 

Author Comment

by:jforget1
ID: 12010387
How do I do a set field in code, I just cannot think of the code.
0
 
LVL 14

Accepted Solution

by:
p_partha earned 125 total points
ID: 12010389
To set somefield in your code just use

Set uidoc=ws.CurrentDocument
uidoc.fieldsettext("<fieldname>","value")

or
set doc =uidoc.document
doc.<fieldname> = "value"

Do a uidoc.close and then do the ws.editdocument true,newdoc

Partha
0
 

Author Comment

by:jforget1
ID: 12010470
Thanks both of you, I should have split this as you both helped, I did not realize until it was to late that the responses were from 2 people.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

777 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