/ Forums / Advansys Formativ / Creating Solutions with Formativ / Using “.find” with custom fields

  • Creator
    Topic
  • #3843
    dstrickler
    Participant

      I’m trying to find the syntax that’s used to search on a field I have created.

      I have tried using:
      sFilter = (“(MAIL) AND (MyCustomField CONTAINS ” + cQuote + “Opened” + cQuote + “)”)

      Note that the string cQuote contains the quote character. If I use “Subject” instead of “MyCustomField”, the search is accepted, and of course works on the Subject field.

      Any clues?

    • Author
      Replies
    • #6376
      Support 1a
      Participant

        Using find with custom fields requires you to specify both the field name and type. The syntax is “<[Field Name], [Data Type]>”.

        Assuming your custom field stores string data, your filter would be:

        sFilter = “(MAIL) AND (<MyCustomField, STRING> CONTAINS “”Opened””)”

        I hope this helps.

        Advansys Support

        #6379
        dstrickler
        Participant

          Thanks!

          #6374
          dstrickler
          Participant

            The word CONTAINS works fine, but BEGINS WITH doesn’t seem to work.

            Any clues?

            #6375
            Support 1a
            Participant

              Try BEGINSWITH instead of BEGINS WITH, i.e

              sFilter = “(MAIL) AND (<MyCustomField, STRING> BEGINSWITH “”Opened””)”

              You may need to call the Refresh method of the messagelist you apply the filter to prior to calling FindMessages, i.e:

              code:


              Set iMsgs = GroupWise.Account.MailBox
              iMsgs.Refresh
              Set iMsgList = iMsgs.FindMessages(sFilter)

              Advansys Support

              #6377
              dstrickler
              Participant

                Looks like Novell has a bug in their documentation! Taken from their web page(s) that document the Object API:

                Groups and Compound Statements Example
                (FROM CONTAINS “TJEFFERSON” OR FROM CONTAINS “jADAMS”) AND (MESSAGE BEGINS WITH
                “When in the course” AND CREATE_DATE = 1776/7/4)

                Once again – thanks for the excellent help!

                #6378
                Support 1a
                Participant

                  Great to hear it works OK. I’ll advise Novell of the problem with the documentation.

                  Advansys Support

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