Greg58 Posted October 25, 2019 Posted October 25, 2019 I have been trying to work this out for a while now but just can't get it to work. I have a ToDo app I am making for my own use. On the ToDo page i have a button that sends non-urgent tasks to a table called TOMORROW. It date stamps the task being sent to TOMORROW with the current date. When I open the app the next day I want a script trigger to go to TOMORROW, check the date of the tasks. All that are less than todays date (which should be all of them), it sends them to the ToDo table. I have it working OK but it only does one record at a time. It won't loop through the records for some reason?? A copy of the script is below. Any advice is appreciated.
comment Posted October 25, 2019 Posted October 25, 2019 7 hours ago, Greg58 said: it only does one record at a time. Does it? I would think it does every 2nd record. That's because when you delete a record, you have already moved to the next record. In addition, if you don't go to the first record before starting the loop, you may be skipping many records at the beginning of your list. And you probably should make sure that all the records you want to process are found, too. -- P.S. I think it's worth repeating: moving data from one table to another is generally not a good idea.
OlgerDiekstra Posted October 25, 2019 Posted October 25, 2019 12 hours ago, comment said: P.S. I think it's worth repeating: moving data from one table to another is generally not a good idea. Comment is right. @Greg58, your last entry in the post Comment refers to states that you're trying to replicate your daughters app. It's very unlikely that this app is moving data between different tables for today and tomorrow. Most likely, it uses tags to filter records in the same table, probably called "today" and "tomorrow". You can do exactly the same in FM by using a field called "tag" and setting it to "today" or "tomorrow".
bcooney Posted October 25, 2019 Posted October 25, 2019 i'd probably have a DateDue. The tomorrow button would set DateDue to get ( current date) + 1. The Tomorrow filter would find DateDue = get(current date) + 1. Agreed, all tasks are in one table. Perhaps with a type, priority, date due, etc.
Greg58 Posted October 29, 2019 Author Posted October 29, 2019 Thanks very much for the replies. I will try to progress it as you have suggested.
Recommended Posts
This topic is 1852 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