?
Solved

Setting a value on another form

Posted on 2008-10-16
4
Medium Priority
?
189 Views
Last Modified: 2013-12-18
Newbie:
lotus Notes 4.6/5
domino r5

In the code below I'm opening up a database form GSS_Pipe.nsf

When it opens I need a field to automatically have a value placed in it from this code...

The field id called "Status"

I need the value of "Status" to be "Lead"

I think it would be just:

doc.Status = "Lead"
??   but guessing ?


Thanks
fordraiders
Dim uiws As New NotesUIWorkspace
	Dim uidoc As NotesUIDocument
	
	Set uidoc = uiws.CurrentDocument
	
	Dim sess As New NotesSession
	Dim oDb As NotesDatabase
	
	Dim doc As NotesDocument
	
	Set oDb = sess.GetDatabase("CHILN6","Stockroom Services\GSS_Pipe.nsf",True)
	If oDb Is Nothing Then 
		Msgbox "Cannot open database"
		Exit Sub
	End If
	
	Set doc = oDb.CreateDocument
	
	doc.Form = "Main Pipeline"
	
	doc.CRSNumber = uidoc.FieldGetText("CTrackingNumber")
	
	
	Call doc.Save(True,False)
	
	' If you like to open new document in Edit mode, add:	
	Call uiws.EditDocument(True,doc)

Open in new window

0
Comment
Question by:fordraiders
[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
  • 2
4 Comments
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 2000 total points
ID: 22733908
Notes or Web?? The difference is huge, as you know, so please tell us always in which context you want your application to work.

Is the value always "Lead" when the form is opened for a new document? Then just make the default value of field equal to "Lead". This works both in Notes and in a browser.

Assuming that you need a Web-solution, as you did in your other questions, you need a different solution. There are several ways to pass info from one form to another:
a. use an agent, and let the agent use the current document's values
b. encode the info you want to pass in parameters that you attach to the URL

Method b needs more explanation:
- attaching the info should result in a URL like
   http: //server.domain.xyz/filepath/dbname.nsf/formname?OpenForm&param1=abc&param2=def
- the receiving form needs a computed field called Query_String, with value Query_String
- in a web context, its value will be set to everything to the right of the question mark, in this case
   OpenForm&param1=abc&param2=def
- you can use @Explode to chop this string into sections
- and once again, to get each parameter

Instead of in the form itself, it can also be done in a WebQueryOpen agent in LotusScript, in a more or less similar manner.
0
 
LVL 3

Author Comment

by:fordraiders
ID: 22735501
lotus script
0
 
LVL 3

Author Comment

by:fordraiders
ID: 22735506
Is the value always "Lead" when the form is opened for a new document? Then just make the default value of field equal to "Lead". This works both in Notes and in a browser.


yes... Perfect  Thanks !
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 22736359
Nice! Saves you a LOT of trouble... :-))
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

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…
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

770 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