110 pts.
 share data between documents created on different Forms in the same Lotus Notes V5 database
How do I share data between documents created on different Forms in the same Lotus Notes V5 database? They are not response documents. I have created fields to capture the document ID, but I don't what my next step is. Thanks

Software/Hardware used:
ASKED: December 2, 2008  9:00 PM
UPDATED: December 12, 2008  8:54 PM

Answer Wiki:
You need to explain what you mean by "share data". If you want Form A to display information from documents using Form B, based on a lookup, you could create a field on Form A, computed for display, that uses @DbLookup, which will go to a view containing the Form B documents, seek a key value from Form A, and return the desired fields from all documents that match. Look in Designer Help for @DbLookup.
Last Wiki Answer Submitted:  December 3, 2008  8:17 pm  by  Ledlincoln   1,620 pts.
All Answer Wiki Contributors:  Ledlincoln   1,620 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

I would just add an other information (if you want to use @DbLookup) :
you have to create a sorted view to achieve that (with a first sorted column on the ID Field) !
Hope it helps …

 4,075 pts.

 

Thanks Ledlincoln and BruceWayne for replying to my question. I was pulled away on some different work so I haven’t tried the @DbLookup yet.

To clarify ‘Share Data’:
Form A has a computed ID field that I know how to display in a field in Form B by checking On Create Formula inherit and Inherit entire and this also creates a link on Form B to Form A.
Now, on Form B a different Names field will have a value entered into it and I need that Name value to also become saved as a Names field on Form A linked document. That is why I used the term Share because I need data to move both ways Form A <—-> Form B.

I hope this is clearer. Let me know.

 110 pts.

 

Hi

In that case, i suggest you put your code in the QuerySave of each document (A & B)
So when you will save document A, it vwill first search document B, check if it is not being edited (to avoid save conflicts) and put the A fields in the B document.
Same technique with the other document….

You have to know that all your data will be double (A fields in doc B and B fields in doc A) !
Not so pretty but it should work…

 4,075 pts.

 

Just to update, I am working on the QuerySave suggestion, which I believe involves NotesDocumentCollection. I have never used this before so I am researching. and trial and error. Any suggestions in Lotus Script would be welcome :)

 110 pts.

 

I have had some success! I am created a subroutine that I call in QuerySave of FormA to set its field with the value from a field in FormB. Here is a snippet. I will add some error checking later.

num = uidoc.FieldGetText(“ID_A_Number”)
Set collection = db.FTSearch(num, 10)
Call collection.FTSearch(num,10)

For j = 1 To collection.Count
Set docA = collection.GetFirstDocument()
Set itemB = docA.GetFirstItem( “FormBfield”)
strField = itemB.text
If strField <> “” Then Exit For

Next

Call uidoc.FieldSetText(“FormAfield”, strField)

I still need to get the FormB part working.

 110 pts.