• Creator
    Topic
  • #4143
    RPP
    Participant

    Hi

    I have been using Formativ to create a link between my Comms Log (a VB app) and the user’s Groupwise emails.

    In order to be able to locate a given email that ‘belongs’ to the Comms Log I was setting the View Name field to an unique identifier. My Formativ Applet could then determine how to handle the email if it saw the Id in the View Name field.

    I have now noticed a side effect of setting the View Name. My outgoing emails no longer look like outgoing emails in my Sent Items. They look more like ‘new’ emails (the To/CC/BC/Subject header are still entry boxes rather than a summary). The emails still can’t be edited so in some respects it doesn’t matter.

    I would prefer to find a better way of doing it now as if using the View Name has caused this problem, it may cause others down the line.

    Looking at my options the best way should be to add a custom field to my email and use that for my identifier.

    I have successfully managed this for emails that have already been saved (and therefore have a Msg ID) but I need to be able to add the field to the composing email.

    I know this can’t be done directly but I am happy to force a “save to draft” as long as the user isn’t bothered by it.

    This command Groupwise.ItemSaveMessageDraft(FolderPath variant) should do that I believe but I can’t get it to work. To be honest I am not sure what the FolderPath variant should be set to.

    I tried “Work In Progress” and also fgwWork but neither appear to work.

    What does it mean by the ‘current message’ (in the help)? I really need to be sure that it is going to definitely save my message (which I have a variable of oMsg for) rather than some other message.

    If there is a better way of attaching an Id to a new email (e.g. some other little used field that we could live without having for it’s original purpose) then please let me know. I don’t really want to ‘trust’ such things as matching the subject and date/time fields to locate an email.

    Thanks

    Simon

  • Author
    Replies
  • #7258
    Support 1a
    Participant

    One of our engineers has supplied the following code to save an item to the Work In Progress folder. Once saved, you could add a custom field using the Object API:

      dim oMsg
      dim iMsgID
      dim iFolderPath
      dim iCounter
     
      ' Save the composing message to WIP folder
      iFolderPath = groupwise.account.owner.displayname & "" &_
      groupwise.account.workfolder.name
     
      Groupwise.ItemSaveMessageDraft(iFolderPath)
     
      ' Get the message ID from view
      iMsgID = groupwise.ItemMessageIDFromView()
     
      ' Some message with large attachments can take some time to save.
      iCounter = 0
      do while iMsgID = "X00"
        utilities.Timer(1)
        utilities.DoEvents()
        iMsgID = groupwise.ItemMessageIDFromView()
        iCounter = iCounter + 1
     
        ' Exit, if we do not get the proper message id
        if (iCounter >= 10) then
          exit do
        end if
      loop
    
      if iMsgID = "X00" then
        msgbox "Message ID not valid."
        exit sub
      end if
     
      ' Get the saved message
      set oMsg = nothing
      set oMsg = groupwise.account.getmessage(iMsgID)
     
      if oMsg is nothing then
        exit sub
      end if
     
      msgbox oMsg.subject
      set oMsg = nothing
    

    Another approach might be to attach a specially named and encoded file attachment to the draft message. The attachment would contain the ID information you need to associate with the message.

    The term ‘current message’ means either the message being composed, or the currently selected message.

    I am not aware of any fields you can access when working with a composing message that won’t be obtrusive to the user. In the past we have done similar things by adding encoding to the end of the body text of the composing message. I don’t know if this would be acceptable in your case.

    I hope this helps.

    Advansys Support

    [This message was edited by Support 3 on July 07, 2005 at 05:05 PM.]

    #7257
    RPP
    Participant

    Thanks

    Lots to think about there – hopefully I will be able to find a method that suits me! The code is particularly interesting.

    I’ll let you know how I get on in due course.

    #7255
    RPP
    Participant

    I have now tried out this code and it does work EXCEPT the code is being run from within the Send event (ItemSend in the Groupwise Application events – pre-Groupwise event).

    When it is run within the Send event it creates a second copy of the message in the Work In Progress folder which IS NOT deleted automatically when the message is sent.

    Furthermore – I have now realised that would have to run this save code on every message just to get it to the point where I can inspect its Field collection. That isn’t a viable solution.

    Expanding on the ‘draft’ message approach I am now working along the following lines.

    I can create an email from my VB app directly into the Work In Progress folder, including my identifier in its “Field” and then display this email for the user to finish off and send.

    However, as soon as they start typing into the draft email it seems to become an X00 again.

    1) It would be useful if you can confirm that an email that is being edited is always an X00?

    Since an X00 doesn’t allow access to the Field definitions/collection my applet can’t test for the Field and I am once more stuck.

    As I said above, if I use the “save as draft” code then I get a message left behind in the WIP.

    2) How does Groupwise know which message is the draft of the one being sent?

    My logic is that if I can tell which message formed the original draft of the X00 that is being sent then I can test that draft message for the Field and tell whether it is of interest to my VB app.

    Groupwise must know what message the draft is because it removes it upon sending!

    This is getting quite frustrating – everytime I feel like I have cracked it, groupwise denies me access to critical information!

    Thanks

    Simon

    #7256
    Support 1a
    Participant

    quote:


    1) It would be useful if you can confirm that an email that is being edited is always an X00?


    My understanding is that the message ID can be something other than X00 is the message hs been saved to the work in progress folder. However, X00 can still be used to access the message. See what MessageIDFromView() brings back. However, for confirmation you would need to ask Novell.

    quote:


    2) How does Groupwise know which message is the draft of the one being sent?


    I suspect this must be internal GroupWise functionality.

    More information might be available over in the Novell GroupWise developer Usenet forums:

    developer-forums.novell.com

    Advansys Support

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