Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Setting a value on another form

Posted on 2008-10-16
4
Medium Priority
?
191 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

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

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…
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…
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

610 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