Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Trouble with tracer

Posted on 2007-10-05
13
Medium Priority
?
213 Views
Last Modified: 2013-12-18
Am having trouble getting the final points on a tracer working properly. One issue is I have a field "platform" which is a checkbox field and may have more than one selection. In the tracer it is only displaying the first selection, what can I adjust to get multi values to show based on the code below. Also I am getting prompted to save when the user clicks the submit button, which is this code. Shouldn't the save in the code take care of that, not sure why it is still prompting me for it.

SendTo := lab_mgr;
CopyTo := copy_to;
BlindCopyTo := "";
Subject := "New Lab Request";
Remark :=
@NewLine +
"Please set up device(s) for the appropriate test and test environments as listed: " + platform  +
@Text(@Created) +
"Click the doclink below to review the request" ;
@MailSend(SendTo; CopyTo; BlindCopyTo; Subject; Remark; "";[IncludeDoclink]);
@PostedCommand([FileSave]);
@Command([FileCloseWindow]);
@PostedCommand([FileCloseWindow]);
@PostedCommand([FileCloseWindow])
0
Comment
Question by:jforget1
  • 7
  • 6
13 Comments
 
LVL 22

Expert Comment

by:Bill-Hanson
ID: 20024438
Use the @Implode formula to convert multiple-values into a delimited string.  Try this:

SendTo := lab_mgr;
CopyTo := copy_to;
BlindCopyTo := "";
Subject := "New Lab Request";
Remark :=
@NewLine +
"Please set up device(s) for the appropriate test and test environments as listed: " + @Implode(platform; ", ")  +
@Text(@Created) +
"Click the doclink below to review the request" ;
@MailSend(SendTo; CopyTo; BlindCopyTo; Subject; Remark; "";[IncludeDoclink]);
@PostedCommand([FileSave]);
@Command([FileCloseWindow]);
@PostedCommand([FileCloseWindow]);
@PostedCommand([FileCloseWindow])
0
 

Author Comment

by:jforget1
ID: 20024466
That worked for the multi-value field, any thoughts on the save, do I need to add a SaveOptions field?
0
 
LVL 22

Expert Comment

by:Bill-Hanson
ID: 20024600
Sorry, I missed the second part of your question.

If you are using R6 or higher, you don't have to use PostedCommand or FileCloseWindow.  Instead, use the new @Command( [CloseWindow] ) function that always executes at the right time (unlike FileCloseWindow).  The new code would become...

SendTo := lab_mgr;
CopyTo := copy_to;
BlindCopyTo := "";
Subject := "New Lab Request";
Remark :=
@NewLine +
"Please set up device(s) for the appropriate test and test environments as listed: " + @Implode(platform; ", ")  +
@Text(@Created) +
"Click the doclink below to review the request" ;
@MailSend(SendTo; CopyTo; BlindCopyTo; Subject; Remark; "";[IncludeDoclink]);
@Command([FileSave]);
@Command([CloseWindow]);

... If you cannot use the newer command, try placing the code in the form's PostSave module (without the call to FileSave, of course).
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:jforget1
ID: 20024640
I am using 6.5, I updated the end of the code to what you have, but it is still prompting to save the doc.
0
 
LVL 22

Expert Comment

by:Bill-Hanson
ID: 20024722
Is there any code in the QuerySave module that might be modifying field values?
0
 

Author Comment

by:jforget1
ID: 20024783
I have the following in the QuerySave which is used to prevent multi users editing at the same time.

Sub Querysave(Source As Notesuidocument, Continue As Variant)
      Dim s As New NotesSession
      Dim doc As NotesDocument
      Dim user As String
      Set doc = Source.Document
      user = s.CommonUserName
      If Not (doc.BeingEdited(0) = "") Then
            If Not (doc.BeingEdited(0) = user) Then
                  Messagebox("This document is being edited by" & doc.BeingEdited(0) & ". Your changes will not be saved.")
                  Continue = False
            Else
                  Continue = True
                  Call doc.Save(True,False)
            End If
      Else
0
 
LVL 22

Expert Comment

by:Bill-Hanson
ID: 20025057
Well, you can take out the call to doc.Save.  It is redundant and may be causing the prompt.  You also do not need to set Continue to True.  It already is True -- you can just "Exit Sub" at that line.

Also, it looks like there's more code in that event than you've posted.  What's after the last "Else" line?
0
 

Author Comment

by:jforget1
ID: 20025184
Sorry missed the last couple lines,

Sub Querysave(Source As Notesuidocument, Continue As Variant)
      Dim s As New NotesSession
      Dim doc As NotesDocument
      Dim user As String
      Set doc = Source.Document
      user = s.CommonUserName
      If Not (doc.BeingEdited(0) = "") Then
            If Not (doc.BeingEdited(0) = user) Then
                  Messagebox("This document is being edited by" & doc.BeingEdited(0) & ". Your changes will not be saved.")
                  Continue = False
            Else
                  Continue = True
                  Call doc.Save(True,False)
            End If
      Else
            Continue = True
            Call doc.Save(True,False)
      End If
End Sub
0
 
LVL 22

Expert Comment

by:Bill-Hanson
ID: 20033745
I would still take out the "Continue = True" and "doc.Save" lines.  They are not needed since Continue is already True; and the document is going to be saved anyway.  Try this code -- it should behave the same way as your existing code, but should not affect the internal "Is Dirty" flag for the NotesUiDocument (which is what causes the prompt).

Sub Querysave(Source As Notesuidocument, Continue As Variant)
      
      Dim s As New NotesSession
      Dim doc As NotesDocument
      Dim user As String
      Set doc = Source.Document
      user = s.CommonUserName
      If (doc.BeingEdited(0) <> user) Then
            Messagebox("This document is being edited by" & doc.BeingEdited(0) & ". Your changes will not be saved.")
            Continue = False
      End If
      
End Sub
0
 
LVL 22

Expert Comment

by:Bill-Hanson
ID: 20033762
Also, Notes has had native document locking since R6.  Why implement your own?  This has been tried many times, and I've never seen a solution that worked 100% of the time.
0
 

Author Comment

by:jforget1
ID: 20033799
Well something did not jive here, When I opened an existing entry and clicked submit, I got prompted to save, and when I did a new request, it told me the request was being edited by (null) and it would not save.

As far as the code, I have used this for several years, I did not know that 6 had a locking in it. How to do put that into effect in place of this code?
0
 
LVL 22

Accepted Solution

by:
Bill-Hanson earned 2000 total points
ID: 20034097
(1) Oops, you're right, you do need to check for null.  Try this code...

Sub Querysave(Source As Notesuidocument, Continue As Variant)
      
      Dim s As New NotesSession
      Dim doc As NotesDocument
      Dim user As String
      Set doc = Source.Document
      user = s.CommonUserName
      If Not (doc.BeingEdited(0) = "") Then
            If Not (doc.BeingEdited(0) = user) Then
                  Messagebox("This document is being edited by" & doc.BeingEdited(0) & ". Your changes will not be saved.")
                  Continue = False
            End If
      End If
      
End Sub

(2) If it's been working, then I wouldn't mess with it.
0
 

Author Comment

by:jforget1
ID: 20034203
As usual, you helped me out here, this final setup worked perfectly. Thanks again.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Integration Management Part 2
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

564 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