i have created a method in a class to send the file to ftp server when ever the field is updated
it is working fine
now i want to run this class with the help of batch job
batch to be run every day at 5:30 pm
i have created a method in a class to send the file to ftp server when ever the field is updated
it is working fine
now i want to run this class with the help of batch job
batch to be run every day at 5:30 pm
Look at the dialog (I took the image from the tutorial mentioned above):
Notice the Batch tab. There you can enable batch processing and set up recurrence.
There are many ways how you can get the data if you want; I even already mentioned one of them in my first reply. If you want to use ModifiedDateTime, you can, for example, save the date of the last execution and when your process runs again, you'll take all data modified after this saved time.
i dont want to ignore that the method run for changes done from previous day 6:30 pm to present day 6:29 pm
you have any other code that can make easy to fetch the changes data
i went through the post.
i have a question how i will run it automatically in schedule time
By the way, are you sure that you want to ignore changes done between 5:30 pm and midnight?
Good, then see the last paragraph of my previous reply. Ask a concrete question if you get stuck somewhere.
The method logic is to send those rows whose date of modifieddatetime
inventTable.modifiedDateTime >= datetobeginUtcDateTime(today(), DateTimeUtil::getUserPreferredTimeZone()) &&
inventTable.modifiedDateTime <= datetoendUtcDateTime(today(), DateTimeUtil::getUserPreferredTimeZone())
i just want to run this class using batch job
You must be able to identify data to be sent. For example, when a record is updated with the field modified (don't use modifiedField(), because it happens before saving and saving doesn't have to occur), you'll write a record to table.
Then you'll implement a batch class processing the data .For example, the batch will read data from a table and either delete processed records, or change their status (so they're not processed again in the next run).
You can either use SysOperation framework (which is recommended) or RunBaseBatch framework. Check out SysOperation introduction, for instance.
André Arnaud de Cal...
293,265
Super User 2025 Season 1
Martin Dráb
231,927
Most Valuable Professional
nmaenpaa
101,156
Moderator