1 Reply Latest reply on Aug 4, 2010 8:56 AM by philmodjunk

    Dynamic Find criteria/Show Find results in a report

    ElizabethKennedy

      Title

      Dynamic Find criteria/Show Find results in a report

      Post

      Hi,

      I have two questions.

      Question 1:  How would I design a script that would ask for the user to input 2 dates and search for records that contain date fields within those two dates?

      Question 2:  I have records that contain several date fields.  I do finds on one or more dates in the records.  Is there any way to design a report that shows only the date fields that fall within the find criteria and not show the entire record with all the date fields?

      Thanks,

      Libby

        • 1. Re: Dynamic Find criteria/Show Find results in a report
          philmodjunk

          Question 1:

          You can use global date fields to for the user to enter the two dates. You can pop up a custom dialog and link two input fields to these global fields or just locate the two global date fields on a layout.

          Using global fields gDate1, gDate2 on a layout, your script might look like this:

          Go To Layout [//specify the layout of the table to be searched unless you are already on that layout]
          Enter find mode[] // clear the pause check box
          Set Field [YourTable::YourDateField ; YourTable::gDate1 & "..." & YourTable::gDate2 ]
          Set Error Capture [on] // keeps "no records match..." dialog from interrupting the script if no records are found
          Perform Find []

          Question 2:

          Sounds like those date fields should be in separate records--perhaps in a related table. Trying to show different parts of different records based on a specified date range or other search criteria would be difficult to impossible to do.