SAP Knowledge Base Article - Public

3085079 - Record is Getting Saved in UI Even Though the Error Message is Triggered

Symptom

You are triggering an error message via Cloud Application Studio Add-On solution if certain criteria is failed to meet. However the entry is getting saved successfully despite of the error message.

Environment

SAP Cloud for Customer

SAP Business ByDesign

SAP Cloud Application Studio

Reproducing the Issue

  1. Login to frontend UI.
  2. Navigate to the relevant path.
  3. Enter the values.
  4. Click on Save.
  5. Error message will be displayed, along with that the entry will also get saved successfully.

Cause

You have written the code and raising the error message from the Before-Save event of the business object. In this case the error message will be raised but it will not block the entry from getting saved.

Resolution

If your requirement is to block the save upon triggering the error message, then move the code and raise the error message from Validation-OnSave of the business object.

You should check if the condition satisfies or not, if yes raise the error message and return false. This return statement will block the document from saving.

Keywords

validation failed entry got saved not respecting error message , KBA , stop saving the object , trigger error message , validation on save , error on before save , AP-RC-BDS-SCR , ByDesign Studio Scripting (ABSL) , AP-RC-BDS-BO , ByDesign Studio BO definition/generation , Problem

Product

SAP Business ByDesign all versions ; SAP Cloud Applications Studio all versions ; SAP Cloud for Customer add-ins all versions