• Creator
    Topic
  • #3904
    rfaude
    Participant

    Hi,

    i want to create a posted task. i wrote the following script.


    %



    Sub Main(Client, GWEvent)

    Call GroupWise.NewTask
    Call Groupwise.TextSetTo (“Faude, Ralf”, true)
    Call Groupwise.TextSetSubject (“[Groupwise] —> Neues Applet erstellen”, False)
    Call GroupWise.FocusSet(26, “”)
    Call GroupWise.TypeText(“1”)
    Call GroupWise.FocusSet(10, “”)
    Call GroupWise.TypeText(“Hello “)
    Call GroupWise.FontBold(True)
    Call GroupWise.TypeText(chr(9) & “Mr Support”)
    Call GroupWise.FontBold(False)
    ‘ Call GroupWise.DateSetEndDateMode

    End Sub


    %


    Where are my problems:

    1. How to create a posted task instead of a “normal” task
    2. When i create a task with this code i have to accept the task. I need a task without accepting.
    3. how can i set the Enddate of the task
    4. the task should placed directly in the calender folder

    Thanks for help

    Ralf

  • Author
    Replies
  • #6579
    Support 1a
    Participant

    You want to add the message directly into the Calendar message store. The technique you were using (the GroupWise.ItemSet… commands) are generally used when you are working with items via the standard GroupWise user interface. To add messages directly into the message store with no normal GroupWise user interface (you could add your own Formativ UI if appropriate), use the methods under GroupWise.Account.

    Here’s an example of how to add a personal task using this technique:

    Sub Main(Client, GWEvent)
    
      dim objTask
    
      ' Create the new task
      set objTask = GroupWise.Account.Calendar.Messages.Add("GW.MESSAGE.TASK", 3)
    
      ' Set some properties
      objTask.OnCalendar = TRUE
      objTask.FromText = GroupWise.Account.Owner.DisplayName
      objTask.TaskCategory = "A"
      objTask.TaskPriority = 1
      objTask.Subject = "This was created using Formativ"
      
      ' Make it due 7 days from now
      objTask.DueDate = Date + 7
    
    End Sub

    You may want to have a look in the ‘Programmers Guide’ for more examples and information.

    Regards,

    Advansys Support

    #6584
    rfaude
    Participant

    Hi,

    thanks for help.
    i read a lot in the api documentation but it is not easy to understand. For example:

    MessageBoxTypeConstants

    These constants identify the box type of a message.

    Constant Value Description
    egwIncoming 1 Incoming.
    egwOutgoing 2 Outgoing.
    egwPersonal 3 Personal.
    egwDraft 4 Draft.

    What is the different between Personal and Draft?

    I am looking for “GroupWise.ItemSetItemType(MessageID String, ItemType eItemType, IsPersonal Boolean)”.
    Where can i get the MessageID?

    Thanks.

    Ralf

    #6580
    Support 1a
    Participant

    These terms have the same meaning as they do in the GroupWise client. A personal item is one that has not been sent to anyone else (i.e a posted item). A draft item is one that is still being worked on, and has not been sent to anyone. A draft item usually resides in the Work in Progress folder.

    Regarding the message ID, these can be obtained a number of ways – it depends on the context in which you are trying to obtain the ID. For example, if you want to obtain the message ID of the opened message in the GroupWise client, you could use GroupWise.MessageIDFromView, or you could use the client property to obtain the command message, then access it’s messageID property:

    Sub Main(Client, GWEvent)
    
      dim iMsg
      set iMsg = Client.ClientState.CommandMessage
      MsgBox iMsg.MessageID
    
    End Sub

    Have a look at the topic “Accessing GroupWise Information” in the programmers guide. It discusses many of these types of issues.

    I hope this helps,

    Advansys Support

    #6581
    rfaude
    Participant

    Hi,

    Thanks for the info’s. It works. Juhu … ;-))

    Sometimes i am a little confused when i do a search in the language guide.

    Sample:

    Sub Main(Client, GWEvent)

    dim iMsg
    dim sMessage
    dim NL
    dim InsTab
    dim Stemp

    NL = Chr(13) & Chr(10)
    InsTab = Chr(9)
    Stemp = NL & NL & _
    “~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~” & NL & _
    “geändert am: ” & Date & ” – ” & Time & NL & _
    “~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~” & NL & NL

    set iMsg = Client.ClientState.CommandMessage
    sMessage = GroupWise.ItemGetText(iMsg.MessageID, itfMessage)
    ‘MsgBox iMsg.MessageID

    sMessage = Stemp & sMessage

    Call GroupWise.TextSetMessage(sMessage, False)

    End Sub

    With the statement GroupWise.ItemGetText i get the message of the task. To modify the text i used first GroupWise.ItemSetText. But it does not work. After searching in the sample scripts i found GroupWise.TextSetMessage. This works fine.

    Thanks again.

    Ralf

    #6585
    Support 1a
    Participant

    Thanks for the update.

    Advansys Support

    #6577
    rfaude
    Participant

    Hi,

    i am not sure where’s the problem. I used the script descibed above. When i start the gw-client or edit the script and open a task first time, the task correctly changed with the additional information. When i open the task again i see the last modification, but when i insert another information the client did not save it.

    A GW-Client without Formativ Extension actuall each time.

    Any idea?

    Ralf

    #6586
    Support 1a
    Participant

    Thank you for your post. I’m not exactly sure I understand your problem. Could you please email the applet in question to support@advansyscorp.com, along with a step-by-step description how to replicate the problem and we’ll have a look at it for you.

    Kind regards,

    Advansys Support

    #6583
    Support 1a
    Participant

    Try the following. Notice the current message is being accessed using the message ID “X00”. “X00” gives you access to the currently opened message in the client, and is generally the ID to use when you want to use the ItemGet… or ItemSet… commands.

    Sub Main(Client, GWEvent)
     
      dim iMsg
      dim sMessage
      dim NL
      dim Stamp
      
      NL = Chr(13) & Chr(10)
      InsTab  = Chr(9)
      Stamp = NL & NL & _
              "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & NL & _
              "geändert am: " & Date & " - " & Time & NL & _
              "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & NL & NL
     
      
      ' Use the X00 message ID when using ItemGet/ItemSet commands.
      sMessage = GroupWise.ItemGetText("X00", itfMessage)
      
      sMessage = Stamp & sMessage
      
      Call GroupWise.TextSetMessage(sMessage, FALSE)  
     
    End Sub
    

    I hope this helps.

    Advansys Support

    #6578
    rfaude
    Participant

    It works fine. Thanks a lot. Greate Job!!!

    Ralf

    #6582
    Support 1a
    Participant

    No problems – glad to be of assistance.

    Advansys Support

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