Text dropped in LS tracer

Posted on 2009-04-23
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
    LVL 46

    Accepted Solution

    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

    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

    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

    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
    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

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Suggested Solutions

    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…
    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…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    732 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now