I have a function when update record of my grid. I explain, this function need connect with api of mailchimp if field record are update, if not are update no need this action.
My problem is as detect email variation, i need data of record after update and before update. Before update no problem, but I do not know how to get the record before updating.
Can you help me?
You can use both events:
$e["on_update"] = array("update_client", null, true);
$e["on_after_update"] = array("update_client", null, true);
The $data will have new posted data. If you want to use old data, you will have to execute another sql query that will read table based on posted ID, and fetch data. This is valid for on_update only (before update event).
$data structure can be checked in demos/editing/custom-events.php code.
How useful was this discussion?
Click on a star to rate it!
Average rating / 5. Vote count:
We are sorry that this post was not useful for you!
Let us improve this post!
Thanks for your feedback!