Hello,
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?
Thank, Sebastian.
You can use both events:
$e["on_update"] = array("update_client", null, true);
OR
$e["on_after_update"] = array("update_client", null, true);
function update_client($data)
{
….
}
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.