Jump to content
Server Maintenance This Week. ×

Looping through records


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

Recommended Posts

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.

 

image.png.e3c107bbecc5272c29f337794fc9ae8d.png

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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".

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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