You need to sign in to do that
Don't have an account?
sandy hello
How to pass current fiscal year or current year dynamically in SOQL query to fetch records created in the current year
I had a requirement to run batch job on records created current fiscal year/current year and the job is executed twice in a year. How to pass curent fiscal year/current year dynamically in soql to fetch records created in current fiscal year.
In you batch class's start method you can get the start date and the end date of the current fiscal year using the below query -
Once you have the currentFiscalYear, all you need to do is in your start method is
I hope this helps.