I have a batch class where i need to grab the records sequentially.
It looks like if i am querying regularly in salesforce and system.debugging the outputs, the records do not seem to be in any specific order.
If i change my query to order by name (which is an autonumber field) will this pass the records in the correct order to my class?
Edit:I have tested using order by and it orders each batch individually but it may run like
- batch 1 - [0-100]
- batch 2 - [400-500]
- batch 3 - [300-400]
- batch 4 - [200-300]