function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SK R.ax1448SK R.ax1448 

Urgent help: Ending dates for Fiscal Quarter

Hi,

I have a custom date field called Currentfiscal__c on a custom object XXX and have custom fiscal years enabled. My requirement is on click, the date that is populated in the calender would be the last date of fiscal quarter instead of current date calender. Could someone give any idea/workaround on how to do this ?. Any help is highly appreciated.

 

 

Thanks in advance

Best Answer chosen by Admin (Salesforce Developers) 
phiberoptikphiberoptik

Ok so you need to use a workflow rule to populate the Date field.

 

1. Create a workflow rule on the custom object with:
     Evaluation Criteria: Evaluate the rule when a record is created, and every time it’s edited

     Run Criteria: Currentfiscal is not equal to ______ [blank]

 

2. Create a workflow action Field Update with:

    Field to update: Currentfiscal

    Use a formula to set value:

 

IF(Currentfiscal__c  >= DATE(YEAR(TODAY()),1,1) && Currentfiscal__c  <= DATE(YEAR(TODAY()),3,31) , DATE(YEAR(TODAY()),3,31),

IF(Currentfiscal__c  >= DATE(YEAR(TODAY()),4,1) && Currentfiscal__c  <= DATE(YEAR(TODAY()),6,30) , DATE(YEAR(TODAY()),6,30),

IF(Currentfiscal__c  >= DATE(YEAR(TODAY()),7,1) && Currentfiscal__c  <= DATE(YEAR(TODAY()),9,30) , DATE(YEAR(TODAY()),9,30),

IF(Currentfiscal__c  >= DATE(YEAR(TODAY()),10,1) && Currentfiscal__c  <= DATE(YEAR(TODAY()),12,31) , DATE(YEAR(TODAY()),12,31),

null))))

 

Click Done & Activate. This will override the date entered into the Currentfiscal__c field to the last day of the quarter based on the four dates you mentioned above.

All Answers

phiberoptikphiberoptik

What does your custom fiscal year look like? What date ranges make up your fiscal quarters?

 

Also, on what click do you want the last date of the fiscal quarter to be displayed in this field?

SK R.ax1448SK R.ax1448

Thank you for your reply.

I have four fiscal quarters,say for example Mar 31, jun 30, sep 30, dec 31. I want to populate these quarter fiscals on 'Currentfiscal__c' field instead current date calender while Edit/update record.


Regards.

SK

phiberoptikphiberoptik

Ok so you need to use a workflow rule to populate the Date field.

 

1. Create a workflow rule on the custom object with:
     Evaluation Criteria: Evaluate the rule when a record is created, and every time it’s edited

     Run Criteria: Currentfiscal is not equal to ______ [blank]

 

2. Create a workflow action Field Update with:

    Field to update: Currentfiscal

    Use a formula to set value:

 

IF(Currentfiscal__c  >= DATE(YEAR(TODAY()),1,1) && Currentfiscal__c  <= DATE(YEAR(TODAY()),3,31) , DATE(YEAR(TODAY()),3,31),

IF(Currentfiscal__c  >= DATE(YEAR(TODAY()),4,1) && Currentfiscal__c  <= DATE(YEAR(TODAY()),6,30) , DATE(YEAR(TODAY()),6,30),

IF(Currentfiscal__c  >= DATE(YEAR(TODAY()),7,1) && Currentfiscal__c  <= DATE(YEAR(TODAY()),9,30) , DATE(YEAR(TODAY()),9,30),

IF(Currentfiscal__c  >= DATE(YEAR(TODAY()),10,1) && Currentfiscal__c  <= DATE(YEAR(TODAY()),12,31) , DATE(YEAR(TODAY()),12,31),

null))))

 

Click Done & Activate. This will override the date entered into the Currentfiscal__c field to the last day of the quarter based on the four dates you mentioned above.

This was selected as the best answer
SK R.ax1448SK R.ax1448

Thank you very much, really appreciate your help.

 

SK R.ax1448SK R.ax1448

One quick question

 

Is it possible / any way to pop up fiscal quarters as a  calender date picker (using VF page / overriding standard functionality)?

phiberoptikphiberoptik

If there is, you are going to want to ask that question in the Visualforce Development forum.


Good Luck.

SK R.ax1448SK R.ax1448

Thank you .

 

Crystal ReganCrystal Regan
How would this be written if your 1st quarter starts Feb 1st?

1st Quarter Ends: 4/30 - Feb, Mar, Apr
2nd Quarter Ends: 7/31 - May, Jun, Jul
3rd Quarter Ends: 10/31 - Aug, Sep, Oct
4th Quarter Ends: 01/31 (next year) - Nov, Dec, Jan

IF(Currentfiscal__c >= DATE(YEAR(TODAY()),1,1) && Currentfiscal__c <= DATE(YEAR(TODAY()),3,31) , DATE(YEAR(TODAY()),3,31), IF(Currentfiscal__c >= DATE(YEAR(TODAY()),4,1) && Currentfiscal__c <= DATE(YEAR(TODAY()),6,30) , DATE(YEAR(TODAY()),6,30), IF(Currentfiscal__c >= DATE(YEAR(TODAY()),7,1) && Currentfiscal__c <= DATE(YEAR(TODAY()),9,30) , DATE(YEAR(TODAY()),9,30), IF(Currentfiscal__c >= DATE(YEAR(TODAY()),10,1) && Currentfiscal__c <= DATE(YEAR(TODAY()),12,31) , DATE(YEAR(TODAY()),12,31), null))))