3 Replies Latest reply on Feb 14, 2013 1:06 PM by pthomas

    Scripting suggestions needed for date range report.


      Here is what I'm trying to do.


      User A needs to run an activity report. User A wants to be able to enter the start and end dates of the report.


      My question / problem is: what is the best way to do this?


      What I would like to do is pop-up a dialog box with two date pickers and have the user select the appropriate dates and then click a button and my script performs the find and then displays the report layout with the appropriate results. What I would like is to store the picked dates in variables but I can't figure out how to do that. I don't really want to create fields for this specific purpose if at all possible. There is an activity date in the table.


      I don't have a problem creating the script(s) to make this happen. I just need suggestions on how to get choice of dates into the find. What do you guys and gals do in a situation like this?




        • 1. Re: Scripting suggestions needed for date range report.

          You will have to create a field for the date selection , even if you place them in a dialogue box.


          The way I generally do this is to create 2 global date fields called g_date_begin and g_date_end.


          The user selects his begin and end dates and executes the script. There is no need to set variables as the global fields are already set. What this also means is that the dates are stored in the global field until they are changed by a new find.


          Remember to add a step in your closing script to reset those fields to "".


          I'm sure there are other ways but  I HTH

          • 2. Re: Scripting suggestions needed for date range report.

            Thanks. That is what I figured. I have done that in the past but I was hoping someone had done something a little more elegant. I appreciate your suggestion.

            • 3. Re: Scripting suggestions needed for date range report.

              Another option if you really don't want to create new fields is to put your existing Activity Date field into the dialog box and then train your users to enter the date range into that box as "startdate...enddate" (maybe put a reminder into the dialog text about how they should be entering the dates).


              Just make sure your script enters find mode before throwing up the dialog box so the user isn't changing the stored data in the activity date field