/ Forums / Advansys Formativ / Creating Solutions with Formativ / Identifying Outgoing Messages

  • Creator
    Topic
  • #4469
    mickeyd
    Participant

    Hi,

    I have an applet that [does a few things] then sends the message. The applet is integrated as a toolbar button on MAIL, APPOINTMENTS and TASKS. The problem is that this button appears also on INCOMING messages where its use is invalid and causes an error.

    To deal with this, I tried to read the BoxType of the message to determine if it is Incoming or Outgoing, then if it’s incoming just do nothing, only execute my applet if it’s an outgoing message. However the value I get for boxtype is not always accurate.

    When I create a new message, the BoxType is Outgoing (correct) and my applet executes correctly. When I read a received email, the BoxType is Incoming (correct) and my applet does not execute (good). The problem is when I REPLY to that incoming message, even though I am essentially composing a new email (and should in my mind have a boxtype of outgoing), it still thinks the current composing message has a BoxType of INCOMING, so my applet doesn’t execute though it should.

    Worse, is when I try to FORWARD a received message, getting the BoxType of that message throws a Token Failed execution error. This is no good.

    Is there another way to accurately determine the direction of the message (incoming or outgoing)?

    Thanks.

  • Author
    Replies
  • #8267
    Support 2
    Moderator

    Hi Mickey,

    Every message in the GroupWise message store is allocated a unique ID that never changes during the life of the message. Items that have not been saved , and therefore have not yet been allocated an ID, can be accessed using the special ID “X00”.

    A workaround might be to check for a composing message (ID=”X00″) before checking BoxType. Alternatively, it may be worth saving as a draft and then using the ObjectAPI to access the BoxType using Message.BoxType.

    Here is some code from our applet source library, which checks the ID and boxtype.

      if (GroupWise.ItemMessageIDFromView <> "X00") then
        Set oMsg = Client.ClientState.CommandMessage
    
        if ((oMsg.boxtype = fgwIncoming) or (oMsg.boxtype = fgwOutgoing)) then
          msgbox "Incoming or outgoing message"
          set oMsg = nothing
          exit sub
        end if
      end if
    
      msgbox "Draft message..."
    

    Hope this helps.

    Kind Regards,

    Advansys Support

    #8265
    mickeyd
    Participant

    That works perfectly! Thank you!!

    #8266
    Support 2
    Moderator

    Our pleasure, thanks for letting us know!

    Kind Regards,

    Advansys Support

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