Add Days to a Salesforce Formula DateTime Field and Adjust for Daylight Savings Time

15 Sep

Adding days to a DateTime field can lead to an unexpected time when the added date passes a daylight savings time. For example, if 7 days is added to 3/9/2018 10:00 AM, the new date will 3/16/2018 11:00 AM because it has passed the daylight savings time date. This occurs because the date is stored in Salesforce’s databases as GMT, and adding days to a GMT date doesn’t adjust for users in zones that observe daylight savings time.

The following works only when your users are always in a timezone that observes daylight savings time.

Salesforce Date Formula for Finding the Next Business Day that Skips Holidays

3 Feb

Finding the next business day using a Salesforce formula field can be challenging, and making the formula skip holiday dates increases the complexity. Below is what I’ve come up with after digging through many examples on the web, and borrowing logic that made sense. I would not call this great because it requires updating the formula field each year, and it is likely that this will be forgotten. But, here it is.

Report on Field Changes in Salesforce

26 Nov

Tracking field history in Salesforce allows you to report on the original and new values of a field. This functionality can be very useful when determining who changed a field value and when it happened. This built-in change tracking has some limits:

  • Only the following standard objects allow field history tracking: Accounts, Cases, Contacts, Entitlements, Service contracts, Contract line items, Contracts, Leads, Opportunities, and Solutions
  • Only 20 fields may be tracked per object
  • Not all field types can be tracked

Continue reading