i have two forms each of which has the doclink they relate. The field where I store the doclink is of type 'RichText'. Then I create the 'form A' and send to the user who will create the 'form B' from a button on the 'form A'. When the user clicks the button 'form A' the 'form B' is created and stored in the field of 'form B' doclink the 'form A' and 'form A' stored doclink of 'form B'. But when I run a command in 'form B' and saved, the icon that represents the field of doclink 'form A' turns blue (instead of yellow). Does anyone know what might be happening?
Asked
Active
Viewed 1,481 times
1
-
Can you please include some code or formulas or screen-shots in order for us to better understand what the issue is please? – pipalia Mar 28 '12 at 18:08
-
Hello aim using 2 forms in my application – Alexandre Oliveira Mar 28 '12 at 18:12
-
Hello, i am using 2 forms in my application: form1 form2 The user1 send the form1 for user2 by send mail: form1.send(user2) When user2 receives the mail, he open the form1 and click on the button 'Accept' and the application create the form2 and link docLink of form1. form2.field1 = "xxxxxxx" form2.field2 = "xxxxxxx" form1DocLink as NotesRichTextItem set form1DocLink = new NotesRichTextItem(form2, "docLink") call form1DocLink.appendDocLink(form1) form2.save(true, false) – Alexandre Oliveira Mar 28 '12 at 18:30
-
and sequentially… form1.field1 = "xxxxxxx" form1.field2 = "xxxxxxx" form2DocLink as NotesRichTextItem set form2DocLink = new NotesRichTextItem(form1, "docLink") call form2DocLink.appendDocLink(form2) form1.save(true, false) after the user2 makes some changes in the form2 and after save, the problem happens: the docLink in form2 which refers to form1 and opens the homepage of the application. The icon that represents the doclink in yellow color change to blue. The same is true when user1 alters subsequently the form1. – Alexandre Oliveira Mar 28 '12 at 18:31
1 Answers
0
First of all you are getting confused between forms and documents. Everything that is stored in Notes is a document, even form is a type of design element that's stored as a document. So you are creating documents and saving documents rather than saving forms.
Here is a simple example and it seems to work for me, hope this will help you in resolving your issue:
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc1 As NotesDocument
Dim doc2 As NotesDocument
Set db = session.CurrentDatabase
Set doc1 = db.CreateDocument
Set doc2 = db.createDocument
doc1.Form = "Form1"
doc2.Form = "Form2"
'Call doc1.Save(True, False)
'Call doc2.Save(True, False)
Dim form1DocLink As NotesRichTextItem
Set form1DocLink = New NotesRichTextItem(doc1, "field1")
Call form1DocLink.AppendDocLink(doc2, "test")
Call doc1.save(True, False)
Dim form2DocLink As NotesRichTextItem
Set form2DocLink = New NotesRichTextItem(doc2, "field2")
Call form2DocLink.AppendDocLink(doc1, "test")
Call doc2.save(True, False)
I created two forms called "Form1" and "Form2". Form1 has a single rich text field "field1" and Form2 has a single rich text field "field2". Also you must remember to save the document before attaching doc links. Hope this helps, if it does please accept this answer.

pipalia
- 911
- 1
- 12
- 46
-
Hello, I'm sorry, I expressed myself wrong. My application does exactly as in your example, the only difference is I have not saved the document before putting the doclink, I put doclink and then saved the document, then I think the problem must be there. Should I change the document, save it, enter the doclink and save it again, right? In the examples of the help of Lotus Designer does not save the document before and after inserting the doclink, so I made this way. – Alexandre Oliveira Mar 28 '12 at 20:36
-
Do you think the error is at this point? I'm sorry if you're not quite understand, I'm from Brazil and do not speak English very well. I'm having the help of google translator. – Alexandre Oliveira Mar 28 '12 at 20:36
-
The way I do doclink is usually inserted, the point is that depending on the change that I make later in the doc2, I do not know why doclink loses the reference of doc1 and when I click on it, it goes to the home page of the application and your icon changes to blue color. – Alexandre Oliveira Mar 28 '12 at 20:40
-
You are doing a good job of explaining yourself Alexandre, so please don't apologise. I commented the two lines of code which save both documents and it still seems to work, so the problem must be elsewhere in the code. Feel free to send me a sample db with the problem and I will be happy to help you - my email is spipalia (at) gmail (dot) com or if you can post a simple example which reproduces the problem that would be really helpful. – pipalia Mar 28 '12 at 21:26
-
Thanks for telling your e-mail. Let me explain from the beginning. I had made this application before, only in the field where he was docLinks are stored in the format 'Text computed' and I did not know that the lotus has problems with fields 'Text' that store docLinks. So in my application I used the command doc1.field = doc2.UniversalID and this was the camp store doclink. Turns out I created a template (. Ntf) of this application to insert another module in the application, but that did not change what had already been done. – Alexandre Oliveira Mar 28 '12 at 21:52
-
I made the changes and then updated the application that was in production (. Nsf). After doing that, when opening documents Lotus began to generate error: "You may not save a document Link into this field unless the linked-to database is the current database." So I open the application and changed the field type "Text" to "RichText" and the error stopped happening. But now this problem of loss of doclink happens, even after changing the code to use NotesRichTextItem. – Alexandre Oliveira Mar 28 '12 at 21:53
-
Sometimes the lotus generates a behavior difficult to understand. I think a platform to develop complicated, with some study material on the Internet. Thankfully, some things to implement in Java, the language I have more knowledge. One thing is bad in the Programmer's pane lotus, he don't reports the error and sometimes there just to find the error debugging. – Alexandre Oliveira Mar 28 '12 at 22:02
-
I know what you mean about lotus being not a great development platform, but the reason why people use Notes is because it's scalable and great for unstructured data. Have you looked at xpages at all (depending on which version of Notes you use - it works from 8.5 onwards, but the really cool stuff is in 8.5.3)? It's based on JSF and built on Eclipse, since you already know Java it's worth looking at. Either way, please feel free to send me a sample database so I can help you better. – pipalia Mar 28 '12 at 22:18
-
OK, thanks. I'm already working a little with XPages, I liked it, but the only problem is the damn Internet Explorer 9, DOJO some things do not work on it, only version 1.6 and forward here in the company we use Lotus Domino 8.5.2. I had a problem in IE9, but skirted implementing a solution manually. I quite liked the XPages, but still have the same knowledge of it as in LotusScript, but I want to make all web applications going forward. One thing that I could not validate a field is "RichText" in XPages, how I do it? With LotusScript I can do, but I do not know XPages. – Alexandre Oliveira Mar 28 '12 at 22:31
-
I would recommend that you post a new question, or check if this question is already answered, I vaguely remember seeing something on here regarding validating a rich text field. – pipalia Mar 29 '12 at 00:41
-
let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/9437/discussion-between-pipalia-and-alexandre-oliveira) – pipalia Mar 29 '12 at 00:42