/ Forums / Advansys Formativ / Creating Solutions with Formativ / Problem creating new email

  • Creator
    Topic
  • #3941
    Anonymous

      I’m working with some of the example scripts with Formativ 1.6 Developer. Specifically:

      New Appointment
      New Email
      New Note
      New Phone Message
      and
      New Task

      The two that use:

      GroupWise.Account.Mailbox.Messages.Add (on line 16)

      fail with:

      Folder.Object
      C:Program FilesAdvansysFormativLocalNew Email_Example.vbf
      An unknown error occurred. at line 16, column 2

      The rest of those examples use something other than “Mailbox”, such as “Calendar”, and they run just fine.

      I’ve also copied and pasted other sample code from the help files, and anything that uses
      GroupWise.Account.Mailbox fails.

      Any ideas?

      Also, a second question: Assuming the “New Email_Example” worked, how would I add an attachment to the message being generated?

      Thanks!

      -Farren

      p.s.: Just for reference, here’s the entire app that’s not working:



      ‘ Create a New Note

      ‘ The following example creates a new note without any user interface.
      ‘ You would normally use this approach when you have all the information
      ‘ required to create a new item, and there is no need for user interaction.


      Sub Main(Client, GWEvent)

      Dim objNote
      Dim objNewNote
      Dim objRecipient

      ‘ Create a draft note message with no user interface
      Set objNote = GroupWise.Account.MailBox.Messages.Add(“GW.MESSAGE.NOTE”, fgwDraft)

      ‘ Add a single recipient – ourself
      Set objRecipient = objNote.Recipients.Add(GroupWise.Account.Owner.EmailAddress,,0)
      With objNote
      .OnCalendar = TRUE
      .Priority = fgwNormal
      .FromText = “Formativ”
      .StartDate = Date
      .Completed = FALSE
      .NotifyWhenCompleted = fgwNoNotify
      .NotifyWhenDeclined = fgwNoNotify
      .Subject = “This note was created using Formativ”
      .BodyText.PlainText = “This is the body text”
      End With

      Set objNewNote = objNote.Send

      Call MsgBox (“Message Id : ” & objNewNote.MessageID, 64, “Formativ”)

      Set objRecipient = Nothing
      Set objNote = Nothing

      End Sub

    • Author
      Replies
    • #6669
      Anonymous

        btw, I’m running GroupWise 6.5

        -Farren

        #6668
        Support 1a
        Participant

          I’ve pasted the applet source code you posted into my GW6.5/Formativ 1.6 Admin installation, and have been able to run the applet successfully. An ‘unknown error’ is normally something that comes deep from within the GroupWise API which Formativ is sitting over. In your case, it appears there is a problem accessing the MailBox folder in your account. Accessing this folder is a fundamental step taken by many applets, and the failure would tend to indicate some type of fundamental error with your account. There are certainly no known issues accessing the Mailbox folder in this way.

          I would suggest you try the same applet while logged into another users account, prefereably on the same PC. If this works you most likely have an account problem that may be fixable by performing account maintenance.

          If it doesn’t work, try the same operation on another computer if possible.

          Once this problem is sorted, adding attachments is quite simple. Given the draft message object returned from the line:

          set objMail = GroupWise.Account.MailBox.Messages.Add(...

          you would access the objMail .Attachments property. For example:

          objMail.Attachments.Add("c:test.txt")

          (This is untested psudocode – but it should point you in the right direction).

          Documentation for the message attachments property can be found here.

          Please let me know how you proceed with the MailBox access problem.

          Advansys Support

          #6670
          Anonymous

            Thanks! Was actually considering that it might be my account, but hadn’t had a chance to test it yet. Will do that and hope for the best. Also, thanks for the bit about attachments. That should be the last piece of my puzzle for this demo.

            -Farren

            #6667
            Support 1a
            Participant

              Thanks for the update. Please let me know how you proceed.

              Advansys Support

              #6666
              Support 1a
              Participant

                It looks like a problem in a recent update to the GroupWise agents may be behind this. Try adding your draft message to the Work in Progress folder instead of the MailBox folder:

                Set iObjMail = GroupWise.Account.WorkFolder.messages.Add("GW.MESSAGE.MAIL", fgwDraft)

                This should work around the problem until Novell fix the issue in the agents (assuming you have less than 5000 messages in your Work in Progress folder).

                Advansys Support

              Viewing 5 replies - 1 through 5 (of 5 total)
              • You must be logged in to reply to this topic.