1
votes

Does beforeSave and afterSave run when files are edited by the administrator in the data browser? Or only when a file is created and saved within an app? Reason I'm wondering is because when I'm changing some column information within an already saved object, I'm getting the error message: "Error: success/error was not called". It would be extremely undesirable for the beforeSave and afterSave methods to run when objects are simply being edited after the fact by an administrator, so I really hope this is not the case.

Thanks if anyone has input.

Cheers.

1

1 Answers

0
votes

Yes, the beforeSave and afterSave triggers are called both when the object is created and when it's modified. Take look at the existed() function.

if(!request.object.existed())
     //is a first-save

} else {
    //just an update

}

Here the official reference.