Jump to content

Changing date for found set in a report


This topic is 4702 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Let me say that this forum has been more than helpful. Thank you so much.

OK, current issue I am working on... I have a "Daily Report" of jobs to be done today. My button to get to this Layout has the following script. (It won't let me cut and paste, so I'll paraphrase my code)

Enter Browse Mode

Go to Layout (Daily Report)

Perform Find (Date [//} (Which brings up a Found Set for the current date)

Sort Records (by Start Time)

Scroll Window (Home)

This works fine and dandy... TODAY. But, let's say I want to pull up this report for Yesterday, or Tomorrow, or The 4th of July?

My thoughts are to put a field in the Header for Date with a pull-down calendar to switch dates. But, do I auto fill it? Do I use the date field from the actual table? Do I create a new field? And, do I need some button action to refresh once I pick a new date?

Link to comment
Share on other sites

Use a global date field to specify the date of the report. Then modify your script to:

...

Go to Layout [ Daily Report ]

Enter Find Mode []

Set Field [ YourTable::Date ; AnyTable::gReportDate ]

Perform Find []

...

do I need some button action to refresh once I pick a new date?

You can attach a script trigger to the gReportDate field.

Link to comment
Share on other sites

I think I got that.

I created a globalDate field (first time with a global field), and it is in the current table. (not sure if it needs to be outside of all the tables, or how to do that)

Then, I dragged that field to the Header (complete with drop down calendar to enter date) Am I supposed to autofill it first with today's date?

Then I did the "set field" script command to set the date within my current table to that value in the globalDate field. (Won't that be editing my records?)

Then I still have the search looking for date[//}. What should that be?

My thoughts are to just change the perform find to "date[globalDate]" (though I don't see a way to do that)

Does that sound right?

Link to comment
Share on other sites

A global field can be in any table.

Am I supposed to autofill it first with today's date?

Not sure what you mean by that. You can set the field to current date when you initiate the script. However, if you wish to change the default, you must create an opportunity for the user to do so.

Then I did the "set field" script command to set the date within my current table to that value in the globalDate field. (Won't that be editing my records?)

No, not if you are in Find mode.

Then I still have the search looking for date[//}. What should that be?

Nothing. Instead of performing find with stored criteria, you enter the criteria while in Find mode, then Perform Find without restore.

Link to comment
Share on other sites

This topic is 4702 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.