Does afterCreate trigger afterUpdate (or vice versa)?

#1

I would like to run an action after an object is created or updated, do I need to implement both functions?

0 Likes

#2

yes. In general you can use a pattern like:

handler(objs) {
// your logic here
}

beforeCreate(objs) {
handler(objs)
}

beforeUpdate(objs) {
handler(objs)
}

1 Like

#3

In case i was not clear:

Yes - you need to implement both functions
No - both functions are not called

0 Likes