Lately I’ve been needing to run some logic after the user has completed changing some things, but before the model is saved. I’ve tried the row.updated event, but it triggers as soon as an item changes rather than when user user says to commit. And models.saved is after the object has been committed. Is there an event I can get when the model is about to be committed - like after the user clicks SAVE and before the actual save is sent to SFDC?
As an example use case, I want to detect when the user enables a checkbox and then set some audit logging in another field (such as the ID of the user who changed it). I don’t want to overwrite the old value if the user should just check and uncheck the box (which is what would happen on row.updated events). And I’d prefer not having to commit the data twice, which is what happens when I use models.saved (and, I no longer have access to the original values, which means I have to manually save values when the object is loaded).
Any other way to get a “before save” event?
Thanks,
- Chris
Is there a before save" event?"
This topic has been closed for replies.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.