• Creator
    Topic
  • #4259
    griesserag
    Participant

      Hello

      I’d like to create a costum filter. The filter should only show items which have specfic values in a personal field. How can I realise that with Formativ? The filter statement should look like this (this is what groupwise shows when I manually create my filter):

      MyType is ‘1’ or MyType is ‘2’ or MyType is ‘3’

      Thanks for your help.

      Regards

    • Author
      Replies
    • #7641
      Support 3
      Participant

        See the Filter Expressions in Object API for more information about the filter expression. See below a sample of the filter syntax:

        (<MyType, STRING> CONTAINS “1”) OR (<MyType, STRING> CONTAINS “2”) OR (<MyType, STRING> CONTAINS “3”) AND (MAIL) AND (BOX_TYPE = INCOMING OR BOX_TYPE = PERSONAL)

        Hope this helps.

        Regards,
        Advansys Support

        #7640
        griesserag
        Participant

          Thanks. But how can I apply this to the current view? So that the user sees only the items which were found by the filter expression.

          Regards

          #7639
          Support 3
          Participant

            See the GroupWise Token API (http://developer.novell.com/documentation/gwtoken/index.html?gwtokens/data/hj8ej8g5.html) and Formativ Language Guide for more information about creating filter. Here is an example:

            dim hFilter
            
            call GroupWise.FilterClear
            hFilter = GroupWise.FilterCreate(fttEmpty, TRUE)
            call GroupWise.FilterSetText(hFilter, fldFrom, "Test", matSubText, "","")
            call GroupWise.FilterApply(hFilter,fatItemList,"")
            

            Regards,
            Advansys Support

            #7638
            griesserag
            Participant

              Thanks for the example. But how can I include the filter statement in the FilterSetText function? So that I can use my personal field instead of fldFrom and search after the values 1, 2 and 3 linked with the or-operator.

              Regards

              #7637
              Support 3
              Participant

                Seems like you can not use the custom filter syntax in FilterSetText token. Another option is to use the query folder. This query/search folder will allow you to use custom filter syntax. See the Query object in Object API (http://developer.novell.com/documentation/gwobjapi/index.html?gwobjenu/data/h7ikbsqg.html) for more information. See below the sample code:

                  
                  const QUERY_FOLDER = "My_Test"
                
                  Dim oQuery
                
                  ' Creates a new Query object
                  Set oQuery = GroupWise.Account.CreateQuery
                
                  oQuery.Expression = "(MAIL) AND (BOX_TYPE = INCOMING) AND (<MyType, STRING> CONTAINS ""1"")"
                
                  ' The locations to be searched.
                  oQuery.Locations.Add(GroupWise.account.mailbox)
                
                  ' Boolean. TRUE means the client will automatically start the query when the
                  ' query folder is opened
                  oQuery.StartOnOpen = TRUE
                
                  ' Creates a new query folder based on this query
                  call oQuery.CreateFolder(QUERY_FOLDER, GroupWise.Account.RootFolder)
                  Call GroupWise.Account.Refresh
                
                  MsgBox ("The folder '" & QUERY_FOLDER & "' created under root folder.")
                
                  Set oQuery = Nothing
                

                Hope this helps.

                Regards,
                Advansys Support

                [This message was edited by Support 3 on June 18, 2006 at 09:20 PM.]

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