Notifications
Announcements
No record found.
Hello,
OK. Maybe you can pint me out to the right direction. I have a runbasebatch extended class which I need to schedule on every day at some point in time. Now when I launch this class I see a dialog with the parameters where I can choose them as I wish. It has got 2 date fields. I must schedule this class so that when it's launched as a batch job every day these two parameters are changed. So they kind of dynamic for my batch job. What is the best approach to achieve that? Should I write additional runbasebatch class which will launch this class with these parameters changed dynamically?
Hi Azat,
You are going to set the date parameters for batch job execution which is set for execution every day. Right? How do you want to change these parameters dynamicslly?
Also, if you are going to set these parameters dynamically, why are you setting this during batch job? Could you please elaborate on the requirement?
Hi,
Could you be so kind to share the screen shot in English, please?
I already have a ready runbasebatch class. I only need to schedule it for execution every day. Right. Now it's launched manually. But it was designed as runbasebatch class with the dialog from above. These parameters actually are fromdate and todate and they are used in the inner logic of the report. This class generates report and sends it to some people. I need every time this batchjob is launched automatically the first parameter fromdate would be 7 days backwards from the current day. And the parameter todate would be today. Let's imahine it was launhced once. Then it launhced tomorrow. todate parameter should change to today and fromdate parameter again should count 7 days backwards. I hope it helps. Pls ask any other questions.
Impossible unfortunately because the application is for russian customer and all tags are russian. but these two parameters I interested in are basically fromdate and todate.
When the class is running in batch, you can set the from and to dates in the run method. If they are being run manuially, they will take into consideration the from and to dates set in the parameters . Try something like this code in the run method
if (this.inbatch()) { fromDate = systemDateGet() - 7; toDate = systemDateGet(); }
OK. I'll try. Thanks and also do you know is there any function which can tell the class that it's launched by some concrete batch job? Because I saw this class is also launched by some other scheduled runbasebatch class and simply changing dates in run method can affect those batch job but not sure. needs to be checked whether those class passes through any fromdate and todate parameters.
Normally a class is associated with one batch process.
How do you think this class is being launched from another runbasebatch class? Please update the cross references and check this.
I see this in the code. One class launches another class with some parameters. But I haven't found this class in any scheduled batch jobs. But in the class in the end method i see this string:
if (this.isInBatch()||email) { some long logic}
So it expects to be launched via batch job.
OK. Thanks a lot. I'll try to figure this out further by myself. Many thanks.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 660 Most Valuable Professional
André Arnaud de Cal... 549 Super User 2025 Season 2
Sohaib Cheema 307 User Group Leader