2 Replies Latest reply on Nov 29, 2012 8:57 PM by MarkNZ

    Script Find for a Value List

    MarkNZ

      Hi all,

      Is it possiable to create a find scripted button that will only find the records that pertain directly to names in a value list ie: ( I have a Field called Status..with value list names .. such as Active, Inactive, Pending,) I want to leave out any rocord that dosnt fit the Value list criteria.

      I would like to set a layout trigger or a button to achieve this once on the layout..

      Any help appreciated.

        • 1. Re: Script Find for a Value List
          ErikWegweiser

          Hi, Mark:

           

          I can think of a couple approaches, depending on a few factors.

          One method would use the ValueListItems( fileName ; valueList ) function to ascertain the values of the list used by the field and store them in a variable (or, of it is a short list, just set the variable to a return-delimited list of those values, such as "Active/Inactive/Pending"

           

          Step 2 would be to perform a script that generates successive requests by looping through the values in the variable containing the value list items. Yes, you'll have to take into consideration whatever else your scripted search needs to accomplish, but this is the basic concept. Oh, and you might want to prefix each request criteria with the "==" symbol, to restrict the search to exact matches.

           

          Another approach is to use a calculation field to store a boolean flag that indicates if the entry in the "Status" field is in the value list. Again, this is simple if your value list is short, like as mentioned above. As with the above approach, you could use an auto-enter number calculation using the ValueListItems function. Your search then, would only need to look for the boolean value (1 = entry is in the list; 0 = not in the list). This does require an additional stored calculation field only for this purpose. Also, if your value list isn't static, this method won't work.

           

          I hope I'm clear enough in describing this as a quick sketch.

           

          -- Erik

          • 2. Re: Script Find for a Value List
            MarkNZ

            Hi Erik thanks for that ... Thanks for your good answer ..Im trying to get my head around it..so thanks