Solved

Setting a value on another form

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

707 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

12 Experts available now in Live!

Get 1:1 Help Now