Symptom
When deleting an attachment through API, the Attachment field in the Employee Central portlet displays the message: "There were problems getting attachment data".
The expectation is to not show the Attachment field anymore at all after its deletion.
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
- OData API Framework
- Employee Central
Reproducing the Issue
- Employee has an attachment in Job Info, for example:
- You delete the attachment through a DELETE API call:
Operation: DELETE
URL: https://api68sales.successfactors.com/odata/v2/Attachment(8701L) - Attachment is properly deleted, but the message "There were problems getting attachment data" is now shown in Job Info:
Cause
After deleting the Attachment file by its ID, the attachment file is deleted in SAP SuccessFactors, but the Job Info record still holds a reference to the file. Therefore, when viewing the Job Info record, it tries to resolve the attachment-id into a filename, but cannot because the file no longer exists.
Resolution
In order to solve this, you need to also Upsert the EC portlet and set its attachmentId field to blank so the reference to the attachment can be removed too.
- First, you can delete the file by doing the DELETE call in Attachment entity:
Operation: DELETE
URL: https://api68sales.successfactors.com/odata/v2/Attachment(8701L) - Afterwards, update the Job Info record and set the attachment-id value to blank:
{
"startDate": "/Date(1745971200000)/",
"userId": "jparca",
"attachmentId": "",
"__metadata": {
"type": "SFOData.EmpJob",
"uri": "EmpJob(startDate=datetime'2025-04-30T00:00:00',userId='jparca',seqNumber='1')"
}
} - Attachment field will now be properly shown with no attachments and no error messages:
Keywords
attachment deletion, attachment-id, profile, attachmentId, delete, , KBA , LOD-SF-INT-ODATA , OData API Framework , LOD-SF-INT-EC , Employee Central SFAPI & OData Entities , Problem
Product
Attachments
| Pasted image.png |
| Pasted image.png |
| Pasted image.png |
SAP Knowledge Base Article - Public