/ Forums / Advansys Formativ / Creating Solutions with Formativ / Filter for Notes isn’t working as I expect. What should I do different?

  • Creator
    Topic
  • #5186
    dgerisch
    Participant

    I’ve made an applet to post Notes to people’s calendars on certain days; but realize that with ubiquitous virtual machines / remote desktops, there is a high likelihood of duplicate posting.

    How to not post the Note again, if it’s been posted once already?

    Seems to me a Filter would be the answer:

    dim iFilter
    dim oMessages

    iFilter = “(NOTE) AND (SUBJECT CONTAINS “”Put note subject line here””)”
    set oMessages = GroupWise.Account.Mailbox.Messages.Find(iFilter)
    msgbox oMessages.count

    This always returns zero. Yes, I’ve tried many variations on the subject line.

    This, on the other hand, returns the count of the number of Notes on my calendar today:

    iFilter = “(NOTE)”
    set oMessages = GroupWise.Account.Mailbox.Messages.Find(iFilter)
    msgbox oMessages.count

    So if I have six Notes on my calendar today, oMessages.count returns six.

    But what I need, is to be able to tell if the note “subject line here” has already been posted for the particular dates months in the future.

    Suggestions on how to make it work?

    GroupWise 2012, SP 3, HP 1, plus an FTF.

  • Author
    Replies
  • #9977
    Support 3
    Participant

    Thanks for your message.

    Your code trying to find messages in Mailbox folder where you should find the messages in Calendar or AllMessages collection. AllMessages will search in all folders so it will take more time to find messages. See the OAPI for more information:
    http://www.novell.com/document…i/data/hyfolkga.html

    Code below find messages in calendar folder:

      
    set oMessages = GroupWise.Account.Calendar.Messages.Find("(NOTE) AND (SUBJECT CONTAINS ""Put note subject line here"")")
    msgbox oMessages.count
    

    Regards,

    Advansys Support

    #9978
    dgerisch
    Participant

    This worked great. Thank you.

    Do you happen to have the format on hand for limiting the search to a date range? Next year, I’ll be asked to post another series of notes, and it would be nice if I can tell that the count in 2016 is either zero (safe to proceed) or greater than that (don’t proceed making duplicates).

    #9979
    Support 3
    Participant

    You can use the following filter syntax to find messages between date range.

      
    GroupWise.Account.Calendar.Messages.Find("(NOTE) AND (START_DATE >= 2016/01/01) AND (START_DATE <= 2016/12/31)")     
    

    Please see the OAPI filter syntax for more information.

    Regards,

    Advansys Support

    #9980
    dgerisch
    Participant

    Thank you very much. Smile

    #9981
    Support 3
    Participant

    You are welcome.

    Regards,

    Advansys Support

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