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
- Login to frontend UI.
- Navigate to the relevant path.
- Enter the values.
- Click on Save.
- 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