May 29, 200421 yr How can I create a script to auto find all records in a date field within 3 months from today?
May 29, 200421 yr This is a straightforward scripting example. You can create and save a scripted find then attach that to a button. I suggest the "Script" forum if you run into issues. It's also a good idea to provide more information in the questions you ask. For instance, do we assume you have a 'Date' field that is stored with each record? If not, there are different issues to deal with.
May 29, 200421 yr Hello Manny, You are talking about a dynamic find here - one that changes as the date moves on. A stored find in a script will not do, as it will retain fixed criteria from the time when it was specified. Instead, I suggest that you set up a scripted procedure that builds the find criteria by referencing the system date. Eg: Go to Layout [Layout with your date field on it] Enter Find Mode [ ] Insert Calculated Result [YourDateField; GetAsText(Date(Month(Get(CurrentDate)) - 3; Day(Get(CurrentDate)) + 1; Year(Get(CurrentDate)))) & "..." & GetAsText(Date(Month(Get(CurrentDate)) + 3; Day(Get(CurrentDate)) - 1; Year(Get(CurrentDate))))] Perform Find [Replace found set] That will roll forward with the system date, so that your find will always return all records in which the entry in the 'YourDateField' field is within the range of +/- 3 months from the current system date.
May 29, 200421 yr Note that you can also use a portal for this. See the "home" layout in the Business Tracker example file.
Create an account or sign in to comment