You need to sign in to do that
Don't have an account?
Del_Santos
Exclude Holidays and Weekends to compute Opportunity Stage Age
Hi There,
Is there a way to calculate the opportunity age per stage excluding holidays and weekends?
Considering the following.
- 8am - 5pm during weekdays.
- Saturday and Sunday is not counted
- Holidays are not counted.
Thanks,
Del
Hi Del ,
This is the formula to exclude week end,
Regards,
Ashish
HI,
This is the formula to calculate business hours,
http://stackoverflow.com/questions/11126378/salesforce-formula-calculate-business-hours-between-two-dates
Regards,
Ashish
Del,
I'm guessing you'd rather do this with Apex code. If so, there is a class, "BusinessHours", with which you can compute the difference between two DateTime instances, excluding time outside of business hours (after hours, weekends, holidays). The BusinessHours static method:
public static Long diff(String businessHoursId, Datetime startDate, Datetime endDate)
If this helps, please mark it as a solution, and give kudos (click on the star) if you think I deserve them. Thanks!
-Glyn Anderson
Certified Salesforce Developer | Certified Salesforce Administrator
Hi ,
Store Holidays using the standard Salesforce Holidays ( Setup | Company Profile | Holidays ). That will calculate the businesshours.
http://help.salesforce.com/HTViewHelpDoc?id=customizesupport_holidays.htm&language=en_US
Regards,
Ashish