I've been trying to troubleshoot an issue I'm having where a flow updates a customer (project) object date field based on the start date field on a related event.
I was using DATEVALUE(StartDateTime) which seemed to work correctly some of the time but was setting the date on the project 1 day before the actual date value in the event. Not sure why.
Then I started reading about the ActivityDate and ActivityDateTime fields in the following help article:
https://help.salesforce.com/articleView?id=000180843&type=1
To me, this statement "For an event, indicates the start date of the event only if IsAllDayEvent is set to true" makes it seem like if it's not an all day event, the ActivityDate field would not be the start date. That is not my experience based on testing with a formula field and the actual flow.
Regardless if the even is all day, an hour, or multi day the ActivityDate field always seems to contain the date value of the start date field on an event.
The hope of this post is that someone can confirm this? I updated the flow from using DATE(StartDateTime) to just using ActivityDate which worked for every scenario in my sanbox but it's not something I can easily test in production so I want to make sure this will work as intended.
Thanks in advance for any info.
3 respuestas
I also ran into the "ActivityDate and StartDateTime must match." error when inserting some Event records using Data Loader. It looks like it only happened to records that were marked as an All Day Event.
The fields I looked at while troubleshooting are as follows (thanks to @Michael Brown for the info above). I've included an example of the values that I was trying to initially insert.
- ActivityDate = 2025-03-26
- ActivityDateTime = NULL
- EndDate = 2025-03-27
- EndDateTime = 2025-03-27T00:00:00.000Z
- IsAllDayEvent = TRUE
- StartDateTime = 2025-03-26T00:00:00.000Z
In order to perform the insert successfully, I simply needed to clear out the ActivityDate field (everything else was left as is).