Solved

Setting a value on another form

Posted on 2008-10-16
4
182 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
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 is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

920 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now