Unable To Restrict Deletion Of Contacts Via Groovy (Doc ID 2044073.1)

Last updated on AUGUST 28, 2015

Applies to:

Oracle Fusion Sales Cloud Service - Version and later
Information in this document applies to any platform.


On : version, Accounts, Contacts, Households

Before Delete in Database and Before Remove triggers and other triggers on Contact are not being triggered
When trying to prevent deletions of Contacts under certain situations which are related to data and roles unable to restrict.
Tried using both the "Before Delete in Database" and "Before Remove" triggers and neither are working even keeping them without any logic other than causing an error is not working.

if (isAttributeChanged('PartyStatus') && PartyStatus == "I")
 throw new oracle.jbo.ValidationException("Cannot delete contact")

Even using the code in "Before Modify" though some big incident error comes it is restricting the contact from being deleted issue also comes with one scenario:
This trigger only works from the user interface and only fires the first time the record is changed. Therefore, if the user edits a field before deleting the Contact, the trigger will not fire and will allow the user to delete the Contact.

So how to throw error message based on a custom validation?


Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms