Solved

Setting a value on another form

Posted on 2008-10-16
4
183 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
  • 2
  • 2
4 Comments
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 500 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

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…
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.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

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