Environment
- Apex
Code
For example I assume that you get a variable of two dates-type as follows already.
Please refer to last entry for details of the FiscalYearCalculation.getLastFiscalYearPeriod
method.
Now, we'll select opportunities which created in last fiscal year as below.
String.valueOf(Date)
method converts from a date to a correct date's format string which is usable in SOQL condition.
For setting correct timezone, You also aren't supposed to forget to use convertTimeZone
.