On Update Event

QuestionsOn Update Event
Sebastián Esteller asked 10 years ago

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.

1 Answers
Abu Ghufran answered 10 years ago

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.

Your Answer

9 + 15 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?