I need to do a batch which calls itself until a condition is true. I don't know how to start. I've tried some things but I got an infinite loop.
The idea is:
- I have a start date Ex: 2019-01-01
- Make some things with that date
- Check if the date is the current date. If true, finish. If false, add 1 day to the start date and run again. (in the 2nd lap the start date would be 2019-01-02, etc.)
How can I achieve this?. I can't do it on a do-while loop, it's neccesary do it in an apex batch.
I hope you can help me. Thanks in advance