• Creator
    Topic
  • #4034
    Anonymous

    I trying to get a seemingly simple script to work for several days now and I’m getting the feeling that something is seriously broken with attachments and shared folders.

    For example open a message and try this trivial script.

    Sub Main(Client, GWEvent)
    set f = client.clientstate.commandmessage
    msgbox f.subject
    set m = groupwise.account.mailbox.messages.add(f)
    End Sub

    This works as expected with local messages, but when you try this on a shared msg, no msg is added. (you still get the subject msgbox, so the msg object is retrieved correctly )

    It gets even more strange:

    Sub Main(Client, GWEvent)
    set f = client.clientstate.commandmessage.attachments.item(1).message
    msgbox f.subject
    set m = groupwise.account.mailbox.messages.add(f)
    End Sub

    try this on any message with another msg attached (local or shared), and you (or at least I) get an “Unknown error” with Messages.Object.

    I got similar errors with attachments.add(), but I haven’t found out yet under which cirumstances. (yes, the owning messages type is egwDraft).

  • Author
    Replies
  • #6912
    Support 1
    Participant

    You have not stated what you are trying to achieve. It appears you are trying to move a message from its folder to the Mailbox folder. If this is true, use the .Move method instead (oSourceFolder & oTargetFolder are local variables initialized as required):

      call oSourceFolder.Messages.Move(f, oTargetFolder.Messages)

    You cannot use .Add or .Move with an attached message; instead, use .Messages.AddExistingMessage(…).

    We have done some testing here, and found that Client.Clientstate.CommandMessage does not work with a shared folder that is owned by someone else. Rather, executing

      set f = Client.ClientState.CommandMessage

    leads to the following error message:

    quote:


    Could not proxy for user at line X, column Y


    However, the following approach to obtaining a message object does work, assuming an item is selected in the message list:

      set f = Client.ClientState.SelectedMessages.Item(1)

    Unfortunately, I cannot get .Messages.Add(f) to work when f is a message in a shared folder that I do not own.

    We have notified Novell of these apparent defects in the GroupWise Object API. Unfortunately Formativ has no control over the behaviour of the GroupWise APIs. These issues are now up to Novell to resolve.

    Advansys Support

    #6911
    Martin
    Participant

    Thanks for your answer.

    quote:


    Originally posted by Support 3:
    You have not stated what you are trying to achieve.


    I just noticed, sorry for that.

    What I originally wanted to achieve was to get a message in a shared folder with commandMessage, extract the message attached to this one, and then create a new msg in the same folder with the extracted msg attached.
    Then I started getting strange errors with .attachments.add().

    quote:


    We have done some testing here, and found that _Client.Clientstate.CommandMessage_ does not work with a shared folder that is owned by someone else.


    That does seem to work on my PC. (I have proxy rights for the owner of the folder)

    quote:


    We have notified Novell of these apparent defects in the GroupWise Object API. Unfortunately Formativ has no control over the behaviour of the GroupWise APIs. These issues are now up to Novell to resolve.


    Thank you, at least now I know that it’s not some specific problem with my code.

    #6909
    Support 1a
    Participant

    Thanks for bringing these issues to our attention. We’ll make a post in this thread when we hear something from Novell.

    Advansys Support

    #6910
    Support 1
    Participant

    Thank you for clarifying your aim.

    In order to create a new message in the same folder as the source message, I suggest you use something like the following:

      set oTargetFolder = Client.ClientState.SelectedFolder
      call oTargetFolder.Messages.Add(f)

    (where f is the source message object).

    If used on a local folder, this should do nothing. If used on a shared folder, this should create a copy of the original message (see the online documentation here for more details on this).

    There is also the .Clone method available in the Message object, but (as I understand the documentation) this will create an extra copy of the message in every folder that contains the original.

    I hope this helps.

    Advansys Support

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