1 Reply Latest reply on Mar 29, 2010 12:04 PM by ninja

    Help with find script? confused

    kilbot

      Title

      Help with find script? confused

      Post

      Okay I have a find script that looks for a global field gInvestigator and the text "OPEN" in the field status. Hers is the script I wrote it is capturing the global field but not the STATUS field(OPEN). This is what I have done:

       

      set varible[$Investigator, gInvestigator]

      set varible[$Status, Status="OPEN"

      enter find mode

      set field [assigned Investigator, $Investigator}

      new record/request

      set field [status, $Status]

      perform find

       

       

      remember status is not a global I just want it to find all cases under that Investigators name that case status is "OPEN"

       

      Thank you

        • 1. Re: Help with find script? confused
          ninja

          Howdy kilbot,

           

          You're mixing up your ANDs and your ORs.

           

          For records containing gInvestigator OR OPEN, use the script you wrote (you don't need to trap the "OPEN" to a variable if that's always the same value).

           

          For gInvestigator AND OPEN:

           


          set varible[$Investigator, gInvestigator]

          set varible[$Status, Status="OPEN"

          enter find mode

          set field [assigned Investigator, $Investigator}

          new record/request

          set field [status, "OPEN" ]

          perform find


           

          Indeed, the setvariable for a global field is really not necessary either...globals are available in find mode.  then it would become:

           


          set varible[$Investigator, gInvestigator]

          set varible[$Status, Status="OPEN"

          enter find mode

          set field [assigned Investigator, gInvestigator]

          new record/request

          set field [status, "OPEN" ]

          perform find


           this will find records where investigator matches AND it is open.