Solved

Problem with carry forward

Posted on 2004-09-08
4
216 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

630 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