Text dropped in LS tracer

Posted on 2009-04-23
Medium Priority
Last Modified: 2013-12-18
Have the code below which I converted to script last year and it was working fine. Now for some reason it is only producing the test below in the email. I have looked thru it but am not sure why it is not getting all the data. What am I missing here.

This is all I get:  An IBPC Refresh survey has been submitted for
Sub Click(Source As Button)
	    ' get and save the current document
	Dim ws As New NotesUIWorkspace
	Dim uidoc As NotesUIDocument
	Dim email As New NotesDatabase("", "")
	Dim doc As NotesDocument, memo As NotesDocument
	Dim body As NotesRichTextItem
	Set uidoc = ws.CurrentDocument
	If (uidoc.EditMode) Then Call uidoc.Save
	Set doc = uidoc.Document
	uidoc.EditMode = True
	Call email.OpenMail
	Set memo = email.CreateDocument
	memo.Form = "Memo"
	memo.Subject = "IBPC Refresh Survey for " & doc.GetItemValue("office_num_adjusted")(0) & " has been submitted"
	memo.SendTo = "Field Technology"
	memo.CopyTo = ""
        ' add a body and a doc link
	Set body = memo.CreateRichTextItem("Body")
	Call body.AppendText( "An IBPC Refresh Survey for " & doc.GetItemValue("office_num_adjusted")(0) & " has been submitted" )
	Call body.AddNewLine( 2 )
	Call body.AppendText("Does the conference room have enough space for 10-15 devices and can be reserved for the entire time?  " & doc.GetItemValue("conf_room")(0))
	Call body.AddNewLine( 2 )
	Call body.AppendText("Does the room referenced above have an active datajack for network connectivity?  " & doc.GetItemValue("data_jack")(0) )
	Call body.AddNewLine( 2 )
	Call body.AppendText("Who will be the On-Site Assistant (OSA) for this location?  " & doc.GetItemValue("osa")(0) )
	Call body.AddNewLine( 2 )
	Call body.AppendDocLink(doc, "", "")
	Call uidoc.FieldSetText("status", "Survey Complete")
	Call uidoc.FieldSetText("survey_flag", "done")
	Call uidoc.Save
        ' send the memo and close the form
	Call memo.Send(False)
	Call uidoc.Close(True)
End Sub

Open in new window

Question by:jforget1
  • 2
  • 2
LVL 46

Accepted Solution

Sjef Bosman earned 1000 total points
ID: 24220366
I assume you run the code on a selected document in a view, or in an open document.

Are you sure there is a field called office_num_adjusted in the document?

Anyway, there are several potential sources for this issue:
1) the code
2) the database (could be corrupt)
3) the Domino server
4) your mail database

So, instead of sending the mail to your mail database, could you create and save it in some test database, or in the same database, as a Memo document? You don't need the form, since you only have to look at the fields using the Document Properties window.

If that Memo-document is wrong, and you indeed have a field office_num_adjusted in it, we really have a problem (that might require Compact, and /or Fixup, etc.)
LVL 22

Assisted Solution

mbonaci earned 1000 total points
ID: 24224417
You can't have "An IBPC Refresh survey has been submitted for" (unless some other code sends the memo), because of:

Call body.AppendText( "An IBPC Refresh Survey for " & doc.GetItemValue("office_num_adjusted")(0) & " has been submitted" )

so presumably you have "An IBPC Refresh Survey for  has been submitted".

Are you talking about Subject or about Body?
Regardless of whether the field exists, you should have in Body all other sentences ("Does the conference room have...",...).

Check whether you have office_num_adjusted field in the uidoc (current document), before triggering the action that send e-mail.

Author Comment

ID: 24224686
Wow you are right, I am not even able to find the code that would do that anywhere. I think that is the code from the old version of the button. Let me see what I can find on this one. Not going to be a good friday.

Author Closing Comment

ID: 31573913
My mistake on this one, I did not see the button which was embedded in the form. The code that I posted was different code, but works perfectly.
LVL 46

Expert Comment

by:Sjef Bosman
ID: 24243106
I also noticed that the text was different, but I ignored them, I assumed they were created when typing. Not one of my best qualities: "assuming"...

Thanks for the grade!

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…

839 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