Symptom
- Application error occurred while trying to save data for MDF object
- externalCode is a required field/association in Object [xxxxxx]
- Users are unable to save data for the custom MDF object
"Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental."
Environment
- SAP SuccessFactors HCM Suite
- Metadata Framework (MDF)
Reproducing the Issue
- Go to Employee Profile and access the MDF Portlet or open the MDF object in Manage Data;
- Click on Edit to add data for the object and click Save;
- User receives an application error with the following message: an application error occurred. Please try again later, or notify support if the issue keeps occurring.
Or an error message: externalCode is a required field/association in Object [xxxxxx]
Cause
Setting externalCode field as Not Visible or Read Only will prevent users to create data, because the system cannot verify whether the externalCode field has unique value or not.
The externalCode field is used to create unique data for the MDF object based on the value entered in this field.
Another possible cause for this error is when a field from the Child Object is placed in the Parent Object section in Manage Configuration UI.
Resolution
Checking the Object Definition to verify if the Visibility of the externalCode field:
- Navigate to Admin Center --> Configure Object Definitions;
- Select Object Definition --> Choose the required object from the dropdown;
- Click on Details option for externalCode field of the selected object's definition;
- Check the Visibility. If it has been set as Not Visible, set it as Editable:
- If the field has been set as Read Only, users will be able to add data on the portlet. However, if any admin user tries to create new data via the Manage Data page or tries to perform import, this field will not be accessible and data for any user cannot be created. Therefore, it is recommended to set the externalCode field as Editable on the object definition.
- Also verify if the field "External Code" is set as visible in the Custom UI under Manage Configuration UI
Important Note: The only scenario where external code could be set as "not visible" is if the Data Type is AutoNumber, because this will guarantee that the external code will always be provided.
The same recommendation is applied for child MDF objects in a scenario of association. The child object needs to have the external code editable or set as AutoNumber.
Also, please make sure to clear the Metadata Cache as another solution attempt as per KBA 2534674 - How To Fix Inconsistencies In Metadata Framework (MDF) - SAP for Me
See Also
2515900 - No Permission Error when creating data for custom MDF object
2534674 - How To Fix Inconsistencies In Metadata Framework (MDF) - SAP for Me
Keywords
externalCode, Visibility, Editable, Not Visible or Read Only, application error, application, error, save, MDF, Object, Portlet, Record , KBA , LOD-SF-MDF-UI , UI Config, Layout & Rules , Problem