Helder Moreira Posted June 5, 2017 Posted June 5, 2017 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
rwoods Posted June 5, 2017 Posted June 5, 2017 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.
Lee Smith Posted June 5, 2017 Posted June 5, 2017 Hi Helder, and welcome to the FM Forums, I sent you a Private Message. Lee
Helder Moreira Posted June 5, 2017 Author Posted June 5, 2017 1 hour ago, Lee Smith said: Hi Helder, and welcome to the FM Forums, I sent you a Private Message. Lee Sorry, i did not get anything
Lee Smith Posted June 5, 2017 Posted June 5, 2017 Hi Helder, Thank you for replying to my Private Message. I hope you have had a chance to read the links I posted, especially Anatomy of a Good Topic? Are your records being served by FileMaker Server 14? Lee
Fitch Posted June 5, 2017 Posted June 5, 2017 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). 1
Helder Moreira Posted June 6, 2017 Author Posted June 6, 2017 9 hours ago, Lee Smith said: Hi Helder, Thank you for replying to my Private Message. I hope you have had a chance to read the links I posted, especially Anatomy of a Good Topic? Are your records being served by FileMaker Server 14? Lee yes, it is on FMS 14
Recommended Posts
This topic is 2725 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 accountSign in
Already have an account? Sign in here.
Sign In Now