2 Replies Latest reply on Sep 21, 2014 7:06 AM by philmodjunk

    get list of records based on date

    ShawnFitzgerald

      Title

      get list of records based on date

      Post

      You guys are so good with everything I hope you can help.  I cannot seem to wrap my mind around dates in a find I have read global fields and performing find but I am not understanding the concept behind it.  So a couple of Questions First.

      Global Field: I see in scripts you use the global field but no where in the script does it input anything in this global field Why is it neccasary and what does it do?

      Perform find:  I see that in scripts you use the perform find and then there are no conditions in it, its just a Enter Find Mode[] .   Why is there nothing in the brackets can I put something in the brackets?

      Set Field: I dont understand setting a field in  a perform find I mean they way it looks in the example scripts your setting a field that already has data in it and its the date thats already in it your trying to search against.  So I dont understand why you use the SET FIELD shouldnt it be called something else or because your in find mode it isnt actualy the field your setting its the data your searching for in that field?

       

      Ok those questions aside this is all I am trying to do and I thought it would be simple I have a table I am viewing in list mode layout but the only records I want it to display have two criteria.  this is all this layout will ever display.

      1. In the Field Table::Fire It should say "yes"

      2. Show only Records that have The Date in Field Table::Due date That is before the current date and then sort those records with the date that is the oldest to be shown first..

      Basically I want to show me all the records that are due because the current date has passed the Due date.

      I know you will have some easy script but I have tried useing the easy scripts shown in other posts and on the knowledge base and it doesent work and I think its cause I am not fully understanding the Global Field and the Perform find function.

      Thank you For all your Help

        • 1. Re: get list of records based on date
          FentonJones

          Here is a short script which does a Find for < Today. I'm using a Enter Find Mode [], Set Field [ a date ], calculation: "<" & Get (CurrentDate) ]
          I thing run Perform Find [].

          Yes, it could be done with less. But I generally prefer using the above method. It can be useful (to me :-) if you want to see it more spread out. This especially useful if someone has changed their mind, about what the Find should do [ and that happens, and often in quite difference results ways; which means changes.

          • 2. Re: get list of records based on date
            philmodjunk

            I think that you are referring to the examples in this thread: Scripted Find Examples

            I see in scripts you use the global field but no where in the script does it input anything in this global field Why is it neccasary and what does it do?

            The presumption behind those steps is that the user has already entered data to be used as criteria in the search into those global fields before clicking a button or tripping a script trigger to perform the script shown. The scripts then use Set Field steps to create the needed find requests with the needed find criteria by accessing the data in those global fields.

            Why is there nothing in the brackets can I put something in the brackets?
            Set Field: I dont understand setting a field in  a perform find

            Notice what happens on a layout when you manually enter find mode. The fields all go blank--except for global fields. As you are no longer on a record but in a "request"--a kind of blank record for specifying find criteria. The same happens for this script. Thus, because you are in find mode, the set field steps are entering search criteria into blank fields of a request instead of altering data in one of your records.

            Why these scripts are set up this way:

                   
            1. When you return to your script months later and no longer remember the criteria used, the criteria is all conveniently listed in the script where you can see it. You don't have to open up some dialogs to see what was specified.
            2.      
            3. The set field steps can use calculations to construct find criteria--from user specified data, get functions, etc not possible in a stored find request.