Symptom
You're trying to create a work schedule using WorkSchedule API and receiving the below error:
{
"error": {
"code": "COE_GENERAL_BAD_REQUEST",
"message": {
"lang": "en-US",
"value": "[COE0018]Please enter at least one day."
}
}
}
Environment
- SAP SuccessFactors HXM Suite
- ODATA API
Reproducing the Issue
- From Postman, you're running below query:
URI: https://<API URL>/odata/v2/upsert?$format=JSON
Body:
{"__metadata": {"type": "SFOData.WorkSchedule"},"externalCode": "5DAY8HOURo","externalName_defaultValue": "5DAY8HOURo","timeRecordingVariant": "DURATION","startingDate": "/Date(1136073600000)/","individualWorkSchedule": false,"modelCategory": "PERIOD","periodModelNav": {"__deferred": {}}} - Click in Send button, receiving below error:
{
"error": {
"code": "COE_GENERAL_BAD_REQUEST",
"message": {
"lang": "en-US",
"value": "[COE0018]Please enter at least one day."
}
}
}
Cause
As error says, when you're creating a new record of work schedule, you need to pass one work schedule day data at least.
To add one work schedule day, you need to add a record for workScheduleDayModels navigation.
Resolution
To add one work schedule day, you need to add a record for workScheduleDayModels navigation as shown below,
URI: https://<API URL>/odata/v2/upsert?$format=JSON
Body:
See Also
Keywords
WorkSchedule, work schedule, COE0018, Please enter at least one day, workScheduleDayModels, ODATA, API, SF, ODATA API, SuccessFactors. , KBA , LOD-SF-INT-ODATA , OData API Framework , Problem