Solved

Problem with carry forward

Posted on 2004-09-08
4
212 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Lotus Notes 8.5 1 168
Calculated single value Text Fields display with scroll arrows 7 59
IBM Lotus Notes Rules not working 5 353
Lotus Notes mail journaling location 4 57
I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

734 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