Jump to content

Restricting data by month


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

Recommended Posts

Hi,

i have the following situation:

i have invoice table, that has all my records, when i enter into this layout list, it has to load all data, depending of internet connection it may take a while.

I would like to restrict it, when i go to layout it shows only current month data, with out portal

 

thanks for any help

Link to comment
Share on other sites

You could create a script that does the 'Find' that you require, and restricts the number of records.  Something like :-

Set Variable [ $startOfMonth; Value:Date ( Month ( Get ( CurrentDate ) ) ; 1 ; Year ( Get ( CurrentDate ) ) ) ]

Perform Find [ Specified Find Requests: Find Records; Criteria: Invoice::date: “≥$startofMonth” ] [ Restore ] 

Then you should add a script trigger to your layout using the 'OnLayoutEnter' option, that runs your script from above.

This is quite crude, and would perform this find every time you enter that layout so you may need to refine it, but this would give you a starting point.

Link to comment
Share on other sites

9 hours ago, rwoods said:

Then you should add a script trigger to your layout using the 'OnLayoutEnter' option, that runs your script from above.

This is quite crude, and would perform this find every time you enter that layout so you may need to refine it, but this would give you a starting point.

You're on the right track, but the problem here is that the script would trigger after you've already landed on the layout
so the server would still have to download whatever records happened to be in the found set.

You should create a simple layout that's based on a layout with zero (or very few) records.

Set this layout as your startup layout.

Attach this script to a button on that layout:

Enter Find Mode
Go to Layout[ invoice list]
Set Field[ date ; Month ( Get ( CurrentDate ) ) & "/" & Year ( Get ( CurrentDate ) )]
Perform Find

You don't incur a penalty when you go to Find mode before you go to a layout.
The server doesn't download data until you go back to Browse mode (after the Find).

  • Like 1
Link to comment
Share on other sites

This topic is 2514 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.