function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Oliver Freeman 9Oliver Freeman 9 

Processes & Email Alerts

Hey Guys,

I've recently created two new fields within a custom object (repair) to track the number of days since an asset undergoing repair changes location.
The two fields are:
- Asset Last Moved (Date/Time) 
- Days since Asset Moved (Formula: TODAY() - Asset_Last_Moved__c)

I then have a process in place which checks repair records when they're edited with the following criteria/formula:
ISCHANGED(Asset_Location__c)

Then when the asset location is changed, it puts TODAY() in the Asset Last Moved field.
The formula then updates the value of Days Since Asset Moved to "0", as expected.
I then have another process which checks the value of Days Since Asset Moved, and every two days that it spends in one location, an email will be sent to the case owner and the engineer - this works fine.
The issue I'm facing is that when an asset is in one location for say 2 days, and then it's moved to another location, for some reason, even though the days since last moved field is updated to "0", it still continues to send an email to the engineer and the case owner saying it's been in the same location for the amount of time that it was there prior to changing the asset location.
Apologies if that doesn't make much sense, I'm struggling to find a simpler way to word what's happening here - I'm assuming it's to do with Salesforce not 'waiting' before sending the email after the record is edited?

Any help would be greatly appreciated.

Thanks,
Oli
Akhil AnilAkhil Anil
Hi Oliver,

You did explain your problem very well :) No need for apologies.

I just have one question. How did you configure the second process to send out an email every two days that it spends in one location ?
Oliver Freeman 9Oliver Freeman 9
Hey Akhil,

Thanks for your reply :)

Please see the screenshot(s) of the process below:

User-added image

User-added image

Thanks,
Oli
 
Oliver Freeman 9Oliver Freeman 9
I've now resolved this problem by using a normal Workflow Rule for the email alerts.
I'm slightly concerned though, as this process doesn't actually edit the record as such, the field that works out the days since moved is just a formula field, so I'm unsure as to whether the workflow rule will pick the change in field value up when it changes each day - we'll see tomorrow anyway.

Thanks,
Oli