Advertisement

07.31.2007 at 04:04PM PDT, ID: 22733314
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.0

Trying to use Computed SubForm & DialogBox as workaround to Rich Text Fields & Hide When Formula issues - HELP!

Asked by PaulCutcliffe in Lotus Domino Email Server, Lotus Notes

Tags: , , ,

I have built a form that relates to a product. The product consists of between 2 & 4 PDF files, depending on the answers to various questions on the form. As the form is filled in, certain sections & questions dynamically appear and disappear, as not all questions apply to all products. This is achieved with various hide-when formulae.

The problem is with the Rich Text Lite fields I am using to store the PDF files. As you may or may not know, there is an issue with hiding Rich Text fields using Hide When formulae. It's something to do with the paragraph(s) contained in the Rich Text field actually taking on the Hide When formulae for itself, rather than just the field displaying or not. Anyway, the recommended workaround involves placing the Rich Text field on a computed subform, rather than directly in the main Form. But the trouble is, this only hides or displays the field when the Document is opened. So answering the questions so that one should appear or disappear doesn't take effect unless you close & re-open the Document.

I have thought of a solution to this, but seem to be having great difficulty in getting it to work. The solution involves placing the Rich Text fields on Computed Subforms, but displaying these on a separate Form displayed in a DialogBox. Cool, huh? Initially I thought I'd have to have an Action Button & associated DialogBox Form for each of the four Rich Text fields, but as this Document is created when you press the Action Button, the Computed Subform trick works a treat, hiding & displaying each field correctly at the time the DialogBox is displayed.

Now here's the problem. NotesUIWorkspace.DialogBox() can be called using the existing Document, or using an alternative NotesDocument. If I use the existing Document, then any existing PDF files are brought from the underlying Document & displayed in the correct field in the DialogBox. But, when I press OK, instead of being saved back to the field from whence it came, it gets attached to the bottom of the Document, below all the fields. And from there I can't seem to find it in LotusScript, & even if I could, I'd have no way of knowing which file was which. If, on the other hand, I create a new NotesDocument in the LotusScript, then display that using the DialogBox, then I can't seem to get any existing PDF files from underlying Document & display them in the DialogBox in the first place. And I dare say I will have the same problem trying to get it back out & into the underlying Document again. The reason is that I can only seem to attach a file from an actual file in the filesystem, & extracting it then attaching it again seems very inefficient.

I've now just tried to get it to work using NotesItem.CopyItemToDocument, to copy the files between the two Documents, but I can get it to go into the DialogBox, but not back again.

Does anyone have any idea how I can solve this?

Here's my current code from the Action Button:

Option Declare

Sub Click(Source As Button)
 Dim session As New NotesSession, dbThis As NotesDatabase
 Dim ws As New NotesUIWorkspace, uiDoc As NotesUIDocument
 Dim strComponents(3) As String, docProduct As NotesDocument, docDialog As NotesDocument, rtiProduct As NotesRichTextItem, rtiDialog As NotesRichTextItem
 
 Set dbThis = session.CurrentDatabase
 Set uiDoc = ws.CurrentDocument
 strComponents(0) = "PDF1"
 strComponents(1) = "PDF2"
 strComponents(2) = "PDF3"
 strComponents(3) = "PDF4"
 Set docDialog = dbThis.CreateDocument()
 Call uiDoc.Save()
 Set docProduct = uiDoc.Document
 Forall c In strComponents()
  Call docDialog.ReplaceitemValue(c & "Status", docProduct.GetItemValue(c & "Status")(0))
  Set rtiProduct = docProduct.GetFirstItem(c & "File")
  If Not Isempty(rtiProduct.EmbeddedObjects) Then
   Set rtiDialog = rtiProduct.CopyItemToDocument(docDialog, c & "File")
  End If
 End Forall
 If ws.DialogBox("dialogSubmitFiles", True, True, False, False, False, False, "Submit/Edit/Resubmit Source File(s)", docDialog, True, False, False) Then
  Forall c In strComponents()
   Set rtiDialog = docDialog.GetFirstItem(c & "File")
   If Not(rtiDialog Is Nothing) Then
    If Not Isempty(rtiDialog.EmbeddedObjects) Then
     Set rtiProduct = docProduct.GetFirstItem(c & "File")
     Call rtiProduct.Remove()
     Set rtiProduct = rtiDialog.CopyItemToDocument(docProduct, c & "File")
     Call docProduct.Save(True, False)
    End If
   End If
  End Forall
  Call uiDoc.Reload
 End If
End SubStart Free Trial
[+][-]07.31.2007 at 04:19PM PDT, ID: 19605213

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.01.2007 at 01:53AM PDT, ID: 19607123

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.01.2007 at 02:44AM PDT, ID: 19607293

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.01.2007 at 06:16AM PDT, ID: 19608400

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.01.2007 at 09:58AM PDT, ID: 19610693

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.02.2007 at 06:15AM PDT, ID: 19616533

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Lotus Domino Email Server, Lotus Notes
Tags: text, rich, subform, computed
Sign Up Now!
Solution Provided By: qwaletee
Participating Experts: 3
Solution Grade: A
 
 
[+][-]08.02.2007 at 07:07AM PDT, ID: 19617028

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.03.2007 at 04:28AM PDT, ID: 19623925

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2007 at 04:35AM PDT, ID: 19623958

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2007 at 08:42AM PDT, ID: 19625969

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.03.2007 at 08:44AM PDT, ID: 19625994

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.10.2007 at 01:38PM PDT, ID: 19673439

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32