5 Replies Latest reply on Nov 8, 2016 9:28 AM by scottworld

    Script that allows users to make multiple find requests

    HawkGX

      Probably not searching correctly for this answer so I'm having a hard time finding the approach I need for my situation.  Our company has a job/order database which includes these fields, relevant to my question:  Job Order Date, and Job Status.

       

      Obviously, the Job Order Date field is a date field where the user inputs the date the order was actually placed.  The Job Status field uses a short value list that contains these values:  Quote, Ordered, Invoiced, Billed, Paid and Not Used.

       

      What I want to do is create a script that users trigger via a button.  I need the script to take them to a layout that allows them to enter a date or range of dates AND to select a value for the Job Status field, then perform a Find based on those multiple requests.  For example, the user wants to find all jobs marked "Billed" that have an order date between 10/1/16 and 11/8/16.

       

      The script will perform the find, take them to a special List view layout that contains the relevant fields for this "report" and sort the found records in Ascending order based on the Order Date field. 

       

      Creating the layouts and script button is no big deal, but I'm having trouble wrapping my head around the best way to create a script that leads the user into entering multiple find requests that result in the found record set I'm looking for.  I'm sure it's pretty simple, but beyond what I'm used to dealing with as far as scripts and find requests are concerned.

        • 1. Re: Script that allows users to make multiple find requests
          scottworld

          That's actually not a multiple find request -- you're looking for a date range. When you are in Find mode, click on the "Operators" button in the toolbar to see a list of all of the operators available to you.

           

          To find a date range between 10/1/16 and 11/8/16, the user would simply type this into the date field (while in Find mode):

           

          10/1/16...11/8/16

           

          So your script -- at its most basic level -- would simply take these steps:

          1. Take the user into Find mode, and PAUSE to wait for the user.

          2. (This is where the user would type in their find request).

          3. Perform the Find, sort the records, and take the user to the List layout.

           

          This is just the most basic steps that your script could take. You could, of course, flesh this out to be much more detailed, trap for errors such as no found records, etc.

          • 2. Re: Script that allows users to make multiple find requests
            BillisSaved

            Good morning HawkGX,

             

            I hope your day is going well. If you implement the suggestion provided by scottwolrd, you could also include a drop down list for your Job Status field. You need to ensure that Find Mode is selected in the Behavior section of the Data tab of the inspector for the field containing the drop down list. Good luck.

             

            God bless,

             

            Bill

            • 3. Re: Script that allows users to make multiple find requests
              HawkGX

              Yes, I guess I understand that the date range they enter PLUS the Job Status option they choose (i.e.  "Billed" or "Ordered" or "Paid", etc) make up one Find request.   

               

              I've created a layout with the Order Date and Job Status fields.  My script currently takes them to that layout and enters Find mode (and pauses for user input). There they can enter in the range of dates into the Order Date field  (10/1/16...11/8/16 or whatever range they choose), and since it's still Paused, they can choose their criteria for the Job Status field (I have it set up as a radio button field in this particular layout). 

               

              There may be instances where a user wants to find records that meet multiple request criteria.  For example, find all records with Order Date between 10/1/16...11/8/16 and are marked as "Billed" PLUS  find all records with Order Date between 10/1/16...11/8/16 and are marked as "Invoiced".  That would actually constitute multiple find requests if I understand correctly.  

               

              Typically, when a user does a find for this type of report, the date range will be the same for any and all find requests.  It would be nice if I could allow the user to enter a global Start Date and global End Date one time during the script, then have the script use those global field values to automatically input the date range they're searching for into the "Order Date" field.

               

              So the user initiates the script, enters a global Start Date and a global End Date. The script uses that input to go into Find mode and create a date range for the Order Date field.  Then the user selects a radio button value for the Job Status field (say, "Billed" for the first request).  THEN the script allows the user to create a 2nd Find Request where the date range (created from the global Start and End Date fields) is still there for the Order Date field, and the user can choose a different radio button value for the Job Status field ("Invoiced" in this instance).

               

              I would think if this possible, then the script could be set up to Loop to allow the User to do as many find requests as they need to capture the records they want to find.  Or am I way off base with that thinking?

              • 4. Re: Script that allows users to make multiple find requests
                philmodjunk

                Once you are in find mode, new record actually creates a new request. Not only does the keyboard shortcut for a new record now create a new request, a button can be placed on the layout in order to create the new request and it would either perform a single script step New record/request or a script with that single line.

                 

                A list view layout with the search fields arranged in a narrow row would make it easier for the user to see the multiple find requests thus created.

                • 5. Re: Script that allows users to make multiple find requests
                  scottworld

                  Yes, you can do that with a script, but global fields can only be data entered in browse mode, so your script would have to account for that. Or, in your case, an easier solution would be to tell the users to duplicate the 1st find request and change the status on the 2nd find request.