2 Replies Latest reply on Jun 24, 2015 9:56 AM by philmodjunk

    Search using blank variable

    MauriceWoods

      Title

      Search using blank variable

      Post

      I am trying to create a Find Utility of sorts to help new users quickly sort through my company's records. Using the "Input Fields" option of the "Show Custom Dialogue" action, I am prompting the user to enter an Part Number, a Serial Number, and a Customer Number.

      Example:

      Please Enter The Following:

      Customer Number: _______
      Serial Number: __________
      Part Number: ___________

      My goal is to allow the user to add any one of (or all of) the three items to produce found results. However, if the user leaves, say, the serial number blank, the assignment of the input value to a variable $serial which is then searched puts the string "$serial" into the find field.

      Is there a way to have the find simply ignore the blank variable and only search with the non-empty values?

      ....I apologize, my wording/vocabulary isn't very clear...

        • 1. Re: Search using blank variable
          MauriceWoods

          I think i may have found a work-around using a web of if(IsEmpty()) statements, but I think I'd be interested to see if there's a easier way....there must be an easier way...

          • 2. Re: Search using blank variable
            philmodjunk

            Make the fields referenced as input fields in the custom dialog global fields. Use the global fields instead of variables to perform the find. If a global field is empty, this leaves the criteria specified in the corresponding field in the table being searched empty and that item is ignored in the find.

            This requires using a script that enters find mode without pausing and then set field steps transfer the values from the global fields to corresponding fields in the table being searched.

            For examples of this kind of script, see: Scripted Find Examples