You need to sign in to do that
Don't have an account?
Eddie Deveau
Field Monitoring, Updating other Fields Based on Last Activity of a Specified Field
I'm not sure if this should be solved w/ flow or programmatically....
over a 12 month period if a specified field has not been updated then a certain score is to be provided for the related account record.
For example if the specified field has been updated within 1-3 months, it is given a score of 5; was updated within 4-6 months, score of 4; updated within 7-8 months, score 3; updated 9-10 months, score 2; updated 11+ months score 1....
Looking for the best practice to solve for this.
over a 12 month period if a specified field has not been updated then a certain score is to be provided for the related account record.
For example if the specified field has been updated within 1-3 months, it is given a score of 5; was updated within 4-6 months, score of 4; updated within 7-8 months, score 3; updated 9-10 months, score 2; updated 11+ months score 1....
Looking for the best practice to solve for this.
The best/ easiest way to go about this is to create a second date or date/time field for the last modified date for that specific field. Then in a simple process builder check if that field value has changed and if so populate the timestamp. Then you could create a formula field to come up with the score by checking the timestamp vs the current time and determining if it is 1-3 months old, 4-6 months old, etc.
There is a programatic solution to this where you could run a scheduled batch class (Would have to be this unless you wait until the object is updated to run through a trigger or a button is pressed to launch the code via a lightning component. But a scheduled batch would do it automatically) to query the object and it's related history something like And then checking the first index of the related history objects createddate
Now the code above hasn't been tested so I can't guarantee functionality but that was just a rough draft of something I think could work. Again, the first solution is simpler and easier to maintain and since it is a formula field once the timestamp is updated it will automatically recalculate rather than a scheduled batch.
If this answers your question please mark as best answer!
Regards,
Tyler