Delete Time Entries
You can use the timeRecordEventRequests resource to delete any time entry on a time card.
The following figure shows that you can use the API to correct entries with data from an external time reporting application to, for example, clear exceptions.
The worker Tom was assigned a work schedule with the 8:00 AM to 5:00 PM shifts for Monday through Friday. A time card already exists for Tom, for the current week. On Monday through Thursday, he reports time from 08:00 AM to 05:00 PM with the Regular Hours payroll time type. On Friday Tom forgets to report his time, so his time and labor manager imports the missing time using the REST service. The imported time entry has this information:
Resource Field | Value |
Start Time |
08:00 AM |
End Time |
05:00 PM |
Payroll Time Type |
Regular Hours |
processMode |
TIME_ENTER |
Tom's manager inadvertently imports the time on Saturday instead of Friday, so the manager has to delete this last entry.
This table shows the prerequisite Time and Labor configuration required to support this scenario.
Configuration | Purpose |
Manage Layout Sets |
Define a layout set where the layouts include a time entry field for payroll time types. |
Manage Worker Time Entry Profiles |
Define a worker time entry setup profile that includes the preceding layout set and assign the profile to the worker. |
This table describes the application processing applied to the imported entry.
Time Record Event Request | Application Processing |
The manager sends the request for the time entry missing from the worker???s time card. |
Imports the time record event request using the REST web service. The processing of the imported entry is done inline in this scenario so there is no need to launch the Process Imported Entries process. |
Prerequisites
Launch GET request to get the ID and the version of the time record to delete. Note that the time entry deletion is performed using a POST action, including a DELETE operation type.
Example URL
The following is the format of the resource URL.
POST
/hcmRestApi//resources/11.13.18.05/timeRecordEventRequests/
Example Request
The following is an example of the request body in JSON format.
{
"processInline": "Y",
"processMode": "TIME_ENTER",
"timeRecordEvent":
[{
"timeRecordId":300100107375192,
"timeRecordVersion":1
"reporterIdType":"PERSON",
"reporterId":"955160008184353",
"comment":"Incorrect entry",
"operationType":"DELETE"
}]
}
Tom's manager can confirm that the process deleted the time entry on either the Manage Time Entries or Manage Time Cards page. Note that the time card has a status of Entered.
Example Response
The following is an example of the response body in JSON format.
{
"timeRecordEventRequestId": 300100272875920,
"processMode": "TIME_ENTER",
"processInline": "Y",
"timeRecordEvent": [
{
"comment": "Incorrect entry",
"crudStatusValue": 2,
"personId": "300100074978533",
"referenceDate": null,
"reporterId": "955160008184353",
"reporterIdType": "PERSON",
"startTime": null,
"stopTime": null,
"subresourceId": null,
"timeRecordEventId": 300100272875921,
"timeRecordEventRequestId": 300100272875920,
"timeRecordId": 300100107375192,
"timeRecordVersion": 1,
"operationType": "DELETE",
"assignmentNumber": null,
"eventStatusValue": 5,
"eventStatus": "COMPLETE",
"measure": null,
"changeReason": null,
"links": [
{
"rel": "self",
"href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecordEventRequests/300100272875920/child/timeRecordEvent/300100272875921",
"name": "timeRecordEvent",
"kind": "item",
"properties": {
"changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
}
},
{
"rel": "canonical",
"href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecordEventRequests/300100272875920/child/timeRecordEvent/300100272875921",
"name": "timeRecordEvent",
"kind": "item"
},
{
"rel": "parent",
"href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecordEventRequests/300100272875920",
"name": "timeRecordEventRequests",
"kind": "item"
},
{
"rel": "lov",
"href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecordEventRequests/300100272875920/child/timeRecordEvent/300100272875921/lov/HcmLookupPVO1",
"name": "HcmLookupPVO1",
"kind": "collection"
},
{
"rel": "child",
"href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecordEventRequests/300100272875920/child/timeRecordEvent/300100272875921/child/timeRecordEventMessage",
"name": "timeRecordEventMessage",
"kind": "collection"
},
{
"rel": "child",
"href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecordEventRequests/300100272875920/child/timeRecordEvent/300100272875921/child/timeRecordEventAttribute",
"name": "timeRecordEventAttribute",
"kind": "collection"
}
]
}
],
"links": [
{
"rel": "self",
"href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecordEventRequests/300100272875920",
"name": "timeRecordEventRequests",
"kind": "item",
"properties": {
"changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
}
},
{
"rel": "canonical",
"href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecordEventRequests/300100272875920",
"name": "timeRecordEventRequests",
"kind": "item"
},
{
"rel": "child",
"href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecordEventRequests/300100272875920/child/timeRecordEvent",
"name": "timeRecordEvent",
"kind": "collection"
}
]
}