SAP Knowledge Base Article - Public

3629974 - Validations not called when deleting OWL instances.

Symptom

Standard Delete action on OWL does not trigger custom validations - example Activity Task OWL:

/BYD_COD/SalesOnDemand/Activities/Task/UI/COD_Task.OWL.uicomponent

Environment

SAP Cloud for Customer

SAP Business ByDesign

SAP Cloud Application Studio

Reproducing the Issue

Pre-requisites - Validations (Eg Validate-On-Save or any action validation) relating to the specific BO in question should be created in a Pdi Add-on that is enabled in the tenant.

  1. Taking example of Activity Task - delete any Activity Task instance from the Activity Task OWL UI screen.
  2. Custom logic designed to validate this deletion is not triggered and instance is deleted regardless of validation conditions in custom logic.

Cause

For some standard OWL screens, the standard 'Delete' action on is not a BO action but rather a UI 'RemoveRow' operation. 

This RemoveRow operation work as below: 

  1. Initially the instance is not deleted but rather the values of that instance are cleared, leaving only an empty instance.
  2. Validations are then triggered however in this scenario since the instance is cleared of value they have nothing to work with and do not trigger or hit breakpoints during a debugging session.
  3. A Finalize action is then triggered which saves this empty instance and with that is removed from the Database effectivly deleting the instance.
  • Please note not all UI components follow this process - some use the Delete BO Action. This is a variance in how different aspects of the product has been developed.
  • The functionality behind a standard delete action in the UI can be determined in the UI designer for the respective UI Component by checking the EventHandler created for the action - See screenshot below.

Resolution

As a work around:

  1. A custom button with a BO Delete action can be configured on the OWL through the UI Designer - see screenshot
  2. Custom validations will then trigger effectively. 
  3. The standard action can be removed through KUT if desired to ensure only one delete option is available

Please note adding of custom button or action may be restricted for UI components in which case a PSM request can be made to allow for this.

Please follow this KBA for how this can be requested:

3444225 - Information Required for PSM Release Requests for SAP Cloud for Customer - https://me.sap.com/notes/3444225 

Keywords

Validation, script not execute, breakpoint not hit. , KBA , AP-RC-BDS-LM , ByDesign Studio Lifecycle Management , Problem

Product

SAP Cloud for Customer core applications 2505