Skip to main content
1 个回答
  1. 2018年1月23日 06:05

    @Raheem: For example, I would start by defining your date ranges:

    Date fiscalQ1Start = date.newInstance(system.today().year().addYears(-1), 10, 1); Date fiscalQ1End = date.newInstance(system.today().year().addYears(-1), 10, 1); Date fiscalQ2Start = date.newInstance(system.today().year(), 1, 1); Date fiscalQ2End = date.newInstance(system.today().year(), 3, 31);

    and so on for Q3 & Q4.

     

    Then use Apex logic to calculate which quarter needs to be used etc.,

     

    Source: https://salesforce.stackexchange.com/questions/48444/how-to-calculate-first-of-prior-quarter-and-last-of-prior-quarter-with-current-d#48451

     

    Also please post such questions on developer forums such as https://salesforce.stackexchange.com or  http://developer.salesforce.com/forums/?id=906F0000000kImyIAE because this community is more focused on configurational and declarational approaches. In those developer forums you can get faster response. Also, Please mark the best answer so as to close the thread and keep the community clean. Cheers !!!
0/9000