Posts

Showing posts with the label DateTime

Salesforce Fact #973 | Date/Time calculation in screen flow

Image
Suppose we have an input Date & Time element in the screen flow and after populating the input, we would like to perform some calculation by adding/subtracting hours and minutes. We can implement the logic using couple of screen elements and formula resource. Attached are the screenshots.

Salesforce Fact #2 | Date check SOQL

If we want to extract the day from a date/time field, we can use the DAY_ONLY function. Suppose, if I want to get the accounts which were created on 1st Jan,2021 we can use the below query: SELECT Name FROM Account WHERE Day_Only(CreatedDate) = 2021-01-01 i.e. (YYYY-MM-DD) Note: we need not enclose the input date inside quotes.