Symptom
You set a field to mandatory in any business object, but you can still process the document and save changes without filling any values to the mandatory field.
Environment
SAP Business ByDesign
Reproducing the Issue
Sample reproduction on Customer Contract BO:
- Navigate to the sales order work center.
- Open the Customer Contract view.
- Enable Adaptation mode.
- Open any contract and navigate to General tab, Renewal and Cancellation subtab.
- Set Minimum Contract Validity to mandatory via adaptation.
- Save changes and publish your settings.
- Now open any contract where Minimum Contract Validity is not set.
- Change the description of the contract and save.
The save is going through, despite having Minimum Contract Validity set to mandatory and not filled.
OR
Sample from Personnel Adminsitration workcenter:
- Go to Personnel Administration
- Find an employee in which Email is blank and Edit
- Go to Personnel Data tab, any subtab
- Save. notice that it saves successfully.
- Make a change. For example add a middle name. Save. Notice that it saves successfully.
- Go to Employment tab, any subtab other than Workplace Contact Data. Save. Notice that it saves successfully.
- Now make a change. For example Notice Period. Save. Notice that it saves successfully.
- Go to Employment tab, Workplace Contact Data subtab. Save.
Notice that it raises an error preventing save: "Save rejected because field (E-Mail) is defined as mandatory by key user"
This is expected because the Email field is configured (through key user adaptation) to be a mandatory field. BUT it should have happened already at earlier save actions.
OR
Sample from Project Management BO:
- Project Management workcenter
- Open a Project
- Select a Task
- Go to the Accounting Tab
- Set the field Customer Group as mandatory
- Close and reopen the Project
- Go to the Basic Data tab
- Change the project name and Save
- This will be saved without issues even if the Customer Group is empty
- Go to the Accounting Tab
- Go to the Basic data tab
- Change the project name and save
Error "Save rejected because field (Customer Group) is defined as mandatory by key user"
Cause
- Mandatory settings via Adaptation are not checked for the whole business document, where they are set, but only apply to already loaded fields from UI side.
- Fields that have not been loaded will not trigger a validation to check the mandatory setting.
- In the contract example, the mandatory check will only be triggered if the user opened the Renewal and Cancellation subtab before saving the contract.
Resolution
This is a confirmed limitation.
You can use a PDI solution to check for entry values that are not loaded from UI for any business object.
Keywords
Mandatory Field; save; Adaptation; empty; save; mandatory; no error, Personnel File , KBA , AP-RC-UIF-RT-B , ByD HTML5 Client (not for Cloud for Customer) , Problem