Solved

NEWBIE: geeting information froma field and pasting into a field on a different form

Posted on 2008-09-29
12
197 Views
Last Modified: 2013-12-18
LN 5
I have 2 forms :

Form1:
I have a form called .nsf called :
Server WBBLN10
FileName: Xref\XrefReq.nsf

The field name is "TrackingNumber"


Form 2:
I have a form called .nsf called :
Server WBBLN5
FileName: Xref\Gss_Pipe.nsf

The field name is "TrackingCodeNumber"

What I need:
When I hit a button :

I need to save the form    "XrefReq.nsf"
Copy the text value from  "TrackingNumber"

Then open the form   "Gss_Pipe.nsf"

Paste the value from  form
XrefReq.nsf
 field "TrackingNumber"

into

"TrackingCodeNumber"


Is this possible ?

Thanks
fordraiders









@Command([FileSave]);

@Command([EditGotoField] ; "CTrackingNumber");

@Command([EditSelectAll]);

@Command([EditCopy]) ;

@Command([Compose]; "WBBLN5"  : "Xref\\GSS_Pipe.nsf" ; "Main Pipeline")
 

????  from here I don't know ?

Open in new window

0
Comment
Question by:fordraiders
  • 6
  • 6
12 Comments
 
LVL 7

Expert Comment

by:olaraak
ID: 22599840
Try something like:

Explanation:
1. save tracking number to variable trNumber
2. compose a new document in another database using form Main Pipeline
3. Switch context to a new document
4. set field TrackingCodeNumber value to trNumber.


trNumber:=CTrackingNumber;

@Command([Compose]; "WBBLN5"  : "Xref\\GSS_Pipe.nsf" ; "Main Pipeline");

@UpdateFormulaContext;

@SetField("TrackingCodeNumber";trNumber);

Open in new window

0
 
LVL 3

Author Comment

by:fordraiders
ID: 22600567
get an unknown function   ------  >        @UpdateFormulaContext;
0
 
LVL 7

Expert Comment

by:olaraak
ID: 22600602
@UpdateFormulaContext was introduced in Lotus Notes version 6.
Have you older Notes version?
0
 
LVL 3

Author Comment

by:fordraiders
ID: 22600618
yes v 5
0
 
LVL 7

Accepted Solution

by:
olaraak earned 500 total points
ID: 22600743
Geez, hard luck then :-)

Maybe you can use LotusSript instead.

In form's QuerySave event, use code:
Sub Click(Source As Button)

	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("WBBLN5","Xref\GSS_Pipe.nsf",False)

	If oDb Is Nothing Then 

		Msgbox "Cannot open database"

		Exit Sub

	End If

	

	Set doc = oDb.CreateDocument

	

	doc.Form = "Main Pipeline"

	

	doc.TrackingCodeNumber = uidoc.FieldGetText("CTrackingNumber")

	

	Call doc.Save(True,False)

	

	' If you like to open new document in Edit mode, add:	

	Call uiws.EditDocument(True,doc)

End Sub

Open in new window

0
 
LVL 7

Expert Comment

by:olaraak
ID: 22600759
sorry, not in querysave, but in button  code.

Also, if you like to save first doc, then add after row:

Set uidoc = uiws.CurrentDocument
Call uidoc.Save
0
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.

 
LVL 3

Author Comment

by:fordraiders
ID: 22600859
So this is the same as adding a new document ?

Could this be called from the queryclose event ?

When they hit the button it closes the current document and runs this code ?

0
 
LVL 7

Expert Comment

by:olaraak
ID: 22600987
When used in queryclose or querysave events, then we need to check that the code runs only once.

Better is to use QuerySave, what runs before saving the document.

It can be done, checking if the document is not saved yet:

if uidoc.IsNewDoc Then

   ... run the code...

end if
0
 
LVL 3

Author Comment

by:fordraiders
ID: 22601933
"variant does not contain an object error" ?
0
 
LVL 3

Author Comment

by:fordraiders
ID: 22602308
I don't know if this would matter...But I'am saving information on a server  and then trying to save the data in memory and then post the data from the fild into a new form on another server...

??

Form1:
I have a form called .nsf called :
Server WBBLN10
FileName: Xref\XrefReq.nsf

The field name is "TrackingNumber"


Form 2:
I have a form called .nsf called :
Server WBBLN5
FileName: Xref\Gss_Pipe.nsf


0
 
LVL 3

Author Comment

by:fordraiders
ID: 22602994
Thanks
0
 
LVL 7

Expert Comment

by:olaraak
ID: 22603102
Thanks for points.

Try to run this code with LotusScript debugger switched on.
You find it from Notes menu File-Tools-Debug Lotusscript (hope in v.5 it was there).

Then open the document and press button or save/close document to get the code run.

Debugger should show on what row error appears. Then it is easier to decide, what's wrong.
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

Suggested Solutions

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…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 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

20 Experts available now in Live!

Get 1:1 Help Now