5
votes
How to add days with Date field?
addDays(additionalDays) Adds the specified number of additional days to a Date.
Date methods
you can simply use addDays method
for(BEV_BillingEvent__c BillingEvent:lstBillingEvent)
{
Date d=...
3
votes
Can different case teams in different territories have different holidays for calculating escalations, etc?
This can be achieved by using Business Hours (one BH record for each territory) and then associating a different set of holidays for each business hours record.
Then use the standard lookup from Case ...
3
votes
Journey Builder | Is there an out of the box feature to send emails on the next day if it falls on a Canadian Statutory Holiday?
It would be pretty difficult to do it mid-journey, as you'd probably need to find a method of making a decision split based in multiple dates (a custom activity perhaps)
You could however do it if it'...
3
votes
Accepted
Apex Business Hours calculation glitch
You've hit upon a problem, all right, but not what you expected; you're using an Integer to try add milliseconds, which means you're limited to about 2 billion before you end up going negative.
...
2
votes
Accepted
How to add days with Date field?
Try the below code. Its much simpler and covers your requirement (I believe).
for(BEV_BillingEvent__c BillingEvent:lstBillingEvent)
{
Datetime dt = DateTime.newInstance(BillingEvent....
1
vote
Calculate No of working days difference between two dates?
For excluding holidays, Configure Business Hours excluding holidays and calculate time difference as below
public static Integer getBusinessHourTimeDifference(Datetime startDate, Datetime endDate)
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
holidays × 16businesshours × 9
apex × 8
date × 3
marketing-cloud × 2
journeybuilder × 2
trigger × 1
soql × 1
unit-test × 1
formula-field × 1
case × 1
service-cloud-console × 1
import × 1
sms × 1
casemilestone × 1
territory × 1
entitlement-process × 1
days × 1