Forum Discussion

angela's avatar
angela
Catalyst II
8 years ago

Purge vs. Delete handling in Server Events

Hi, Is it possible to differentiate between delete and purge when performing an onAfterDelete or onBeforeDelete Server Event? Unfortunately an "onPurge" event is not available, but maybe it´s possible to 'simulate' that? Thanks!

2 Replies

  • Hello, You can use the sample below to determine if an item is being purged from either an onBeforeDelete or an onAfterDelete server event.
    // This action can either be "purge" or "delete"
    if (this.getAction() == "purge") {
    // Handle the case where you are purging
    }
    Chris _______________________________________ Christopher Gillis Aras Labs Software Engineer
  • Hi Chris, it works, thanks! I am now even quite happy that there is no separate 'onPurge' Event... With this code, I only have to add a few lines in the Method, instead of writing a completely new one.