+ Start a Discussion
Paul Johnson 40Paul Johnson 40 

Trying to check if the date part of a date time changes

Hi all -- I'm trying to create a Process Builder flow to send an email alert if the end user changes the DATE of an event (if they change the time, but leave the date the same it should not fire).  I'm trying this formula for the criteria:

AND(NOT(ISNEW()),
OR(
DATEVALUE(PRIORVALUE([Event].StartDateTime)) != DATEVALUE([Event].StartDateTime), DATEVALUE(PRIORVALUE([Event].EndDateTime) != DATEVALUE([Event].EndDateTime)
)


When it fires I get this error:
Error element in formula: the field StartDateTime is not merge-field visible in ISCHANGED and PRIORVALUE

The process is set to fire on creation and edit, but I don't want an email when the record is first created, hence the NOT(ISNEW()).

What is the error trying to tell me?

Thanks!
Paul
 
Best Answer chosen by Paul Johnson 40
Paul Johnson 40Paul Johnson 40
I finally got this work in Process Builder (my next step was to look at a Flow).  I ended up adding two custom formula fields to the Activity object (after going down the Events aren't really Events they are Activities rabbit hole) called Start_Date and End_Date and then using those in my criteria.  This allowed me to not even have to deal with the time at all.

Start_Date__c =  ActivityDate 
End_Date__c =  Start_Date__c + (DurationInMinutes/60)/24 

AND(
NOT(ISNEW()),
OR
(
PRIORVALUE([Event].Start_Date__c)  != [Event].Start_Date__c,
PRIORVALUE([Event].End_Date__c)  != [Event].End_Date__c
)

Still don't know why the original wouldn't work, but I'm moving on...

All Answers

SwethaSwetha (Salesforce Developers) 
HI Paul,
Do you have the Critical Update “Check for Null Record Variables or Null Values of Lookup Relationship Fields in Process and Flow Formulas" activated in your org? If yes, can you disable and see if the error can be replicated?

Related Known Issue:https://trailblazer.salesforce.com/issues_view?id=a1p4V000001qO2oQAE

If this information helps, please mark the answer as best.Thank you
Ron Davis 2Ron Davis 2

Exotic Cats For Sale - Fun Bengal Facts

Having read the basic facts about exotic Bengal cats for sale, you may now read even more interesting ones. There are a whole lot of amazing facts about Bengal cats but the ones featured here are some of the very best.
Ron Davis 2Ron Davis 2

Everything About Cannabidiol Crystals: Wholesale CBD Flower UK, Effects, Dosage, and How to Use Them Correctly.

You’ve heard about wholesale cbd flower uk , CBD crystals and you’d like to know more? Cannabidiol crystals are obtained from Cannabis Sativa buds with a prevalence of CBD (cannabidiol). CBD is a component of Cannabis with soothing, anti-inflammatory, and anti-convulsant effects. Furthermore, unlike the more famous THC (tetrahydrocannabinol), it does not have psychotropic effects. For this reason, CBD crystals can be purchased without a doctor’s prescription.


 
Paul Johnson 40Paul Johnson 40
I finally got this work in Process Builder (my next step was to look at a Flow).  I ended up adding two custom formula fields to the Activity object (after going down the Events aren't really Events they are Activities rabbit hole) called Start_Date and End_Date and then using those in my criteria.  This allowed me to not even have to deal with the time at all.

Start_Date__c =  ActivityDate 
End_Date__c =  Start_Date__c + (DurationInMinutes/60)/24 

AND(
NOT(ISNEW()),
OR
(
PRIORVALUE([Event].Start_Date__c)  != [Event].Start_Date__c,
PRIORVALUE([Event].End_Date__c)  != [Event].End_Date__c
)

Still don't know why the original wouldn't work, but I'm moving on...
This was selected as the best answer
Cassie HowellCassie Howell
Starting a garden (https://weedseeds.garden) can be an exciting and rewarding experience, but it's also a lot of work. Between planning the garden itself, securing the necessary supplies and tending to the plants, there's not much time left over for anything else. That's why it's so important to plan ahead when it comes to starting your garden. First, you'll need to decide how big of a space you'd like to use for your garden. Next, you'll need to figure out where you're going to plant your seeds. Once that's all taken care of, it's time to start getting your supplies ready. When it comes to seeds, make sure that you buy good quality seeds that are well-suited for your local weather conditions. And since growing plants takes time and resources, make sure that you have enough room and supplies on hand before you begin.