/ Forums / Advansys Formativ / Creating Solutions with Formativ / Change the Property of a task

  • Creator
    Topic
  • #4136
    embru
    Participant

    Sorry – i’m posting the next question.

    My applet generates a task message with xml data to display the task as a form. Now i have to include a state-variable to interprete the actual state of this task.

    I see 2 possibilities: one is that i include a state variable in my xml data, doing this – i have to generate new messages or updating the message body (containing the xml string).

    the other way is to use a “non-used” property of the message to save my task-state. I choose the property “TaskPriority”. Which Method must i use to save the message’s property, when i want to change an existing task in my mailbox? Which statements are necessary if i want to change the message bodytext of an existing task – message?

    Thanks for your help.

  • Author
    Replies
  • #7233
    Support 1a
    Participant

    When you are working with messages in the message store, you generally use the standard Object API objects. The Object exposes all the properties you need. The Task object is documented here:

    http://developer.novell.com/ndk/doc/gwobjapi/index.html?gwobjenu/data/h7ikbsqg.html

    The Body property is exposed on the Message Object type (Task is a sub-class of Message). Message is documented here:

    http://developer.novell.com/ndk/doc/gwobjapi/index.html?gwobjenu/data/h7ikbsqg.html

    Note you can only change the body and priority of Posted items – these properties are going to be read-only on a non-poseted item.

    I hope this helps.

    Advansys Support

    #7234
    embru
    Participant

    This answer doesn’t help me. What is to do, when i want to change the properties. My Code look as follows:

    set mClient = oClient
    set mMsg = mClient.ClientState.CommandMessage
    MsgBox(mMsg.TaskPriority)
    mMsg.TaskPriority = 2
    msgBox(mMsg.TaskPriority)

    Something is missing. The first MsgBox tell me the actual TaskPriority. The following Code is ignored, the second MsgBox will not be shown and the TaskPriority has the same value as before.

    Thanks

    #7235
    Support 1a
    Participant

    As mentioned above, most message properties are read only when accessing incoming & sent items – including Task priority. Attempting to set such properties on a readonly item will result in an exception, which is why the rest of your code does not execute.

    TaskPriority can be set for draft & personal messages only. Here is some code…

    if (mMsg.BoxType = fgwpersonal) or (mMsg.BoxType = fgwDraft) then
      mMsg.TaskPriority = 2
    end if
    

    Advansys Support

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