New answers tagged


I understand your question to mean that Turnover Date should reflect the last date/time that Turnover was changed. This cannot be done on a formula on its own. A workflow rule, process builder or flow can do the trick (if Turnover is changed, update Turnover Date to current time), or you can enable history tracking for the Turnover field.


When it run on insert, Trigger.oldMap is empty, so when you say Trigger.oldMap.get(kav.Id) it will return NULL, and then when you say Trigger.oldMap.get(kav.Id).LastPublishedDate it will give you the null pointer exception, since you are trying to get something on a NULL. It's also possible you get a NULL pointer exception over here: ...


Fixed it - just had to enable the Allow Recursion option. Credit to @Moonpie


Because the way that Formula fields work (they are processed last or nearly last in the chain) you cannot use them to properly control your process. Code the formula in your process.

Top 50 recent answers are included