Update Time Entries
You can use the timeRecordEventRequests resource to update any time entry on a time card.
The following figure shows that you can use the API to import data from an external time reporting application to, for example, clear exceptions.
The worker Tom was assigned a work schedule with the 9:00 AM to 5:00 PM shifts for Monday through Friday. A time card already exists for Tom, for the current week. On Monday, Tom reports time from 09:00 AM to 04:30 PM with the Regular Hours payroll time type. On Tuesday through Friday, he reports time from 09:00 AM to 05:00 PM, also with the Regular Hours payroll time type, and submits his time card for approval. Due to an exception on Monday, because Tom reported less than 8 hours, the time card has an Entered status and a warning exception attached to it.
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. |
Manage Time Repository Rules |
Define a time entry rule for all payroll time types using the delivered template Period Minimum Hours Template. |
Manage Time Repository Rule Sets |
Define a time entry rule set that includes the preceding time entry rule. |
Manage Worker Time Processing Profiles |
Define a worker time processing setup profile that includes the preceding time entry rule set and assign the profile to the worker. |
The following table describes the application processing actions applied to the imported entry.
Time Record Event Request | Application Processing |
The manager sends the request for the time entry to be fixedfrom the worker???s time card. |
|
Prerequisite
Launch GET request to get the ID and the version of the time record to update. Note that the time entry update is performed using a POST action, including an UPDATE operation type.
Example URL
The following is the format of the resource URL.
PATCH
/hcmRestApi/resources/11.13.18.05/timeRecordEventRequests/
Example Request
The following is an example of the request body in JSON format.
{
"processInline": "N",
"processMode": "TIME_SAVE",
"timeRecordEvent":
[{
"timeRecordId":300100107375192,
"timeRecordVersion":1,
"stopTime":"2017-06-19T17:00:00.000-08:00",
"reporterIdType":"PERSON",
"reporterId":"955160008184353",
"comment":"Incorrect stop time",
"operationType":"UPDATE"
}]
}
Tom's manager can review the updated entry on Monday on either the Manage Time Entries or Manage Time Cards page. Note that the time card status is Saved and no more exception exists.
Example Response
The following is an example of the response body in JSON format.
{
"timeRecordEventRequestId": 300100272804964,
"processMode": "TIME_SAVE",
"processInline": "N",
"timeRecordEvent": [
{
"comment": "Incorrect stop time",
"crudStatusValue": 1,
"personId": "300100074978533",
"referenceDate": null,
"reporterId": "955160008184353",
"reporterIdType": "PERSON",
"startTime": null,
"stopTime": "2017-06-19T17:00:00.000-08:00",
"subresourceId": null,
"timeRecordEventId": 300100272804965,
"timeRecordEventRequestId": 300100272804964,
"timeRecordId": 300100107375192,
"timeRecordVersion": 1,
"operationType": "UPDATE",
"assignmentNumber": null,
"eventStatusValue": 5,
"eventStatus": "COMPLETE",
"measure": null,
"changeReason": null,
"links": [
{
"rel": "self",
"href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecordEventRequests/300100272804964/child/timeRecordEvent/300100272804965",
"name": "timeRecordEvent",
"kind": "item",
"properties": {
"changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
}
},
{
"rel": "canonical",
"href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecordEventRequests/300100272804964/child/timeRecordEvent/300100272804965",
"name": "timeRecordEvent",
"kind": "item"
},
{
"rel": "parent",
"href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecordEventRequests/300100272804964",
"name": "timeRecordEventRequests",
"kind": "item"
},
{
"rel": "lov",
"href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecordEventRequests/300100272804964/child/timeRecordEvent/300100272804965/lov/HcmLookupPVO1",
"name": "HcmLookupPVO1",
"kind": "collection"
},
{
"rel": "child",
"href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecordEventRequests/300100272804964/child/timeRecordEvent/300100272804965/child/timeRecordEventMessage",
"name": "timeRecordEventMessage",
"kind": "collection"
},
{
"rel": "child",
"href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecordEventRequests/300100272804964/child/timeRecordEvent/300100272804965/child/timeRecordEventAttribute",
"name": "timeRecordEventAttribute",
"kind": "collection"
}
]
}
],
"links": [
{
"rel": "self",
"href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecordEventRequests/300100272804964",
"name": "timeRecordEventRequests",
"kind": "item",
"properties": {
"changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
}
},
{
"rel": "canonical",
"href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecordEventRequests/300100272804964",
"name": "timeRecordEventRequests",
"kind": "item"
},
{
"rel": "child",
"href": "https://<host>:<port>/hcmRestApi/resources/11.13.18.05/timeRecordEventRequests/300100272804964/child/timeRecordEvent",
"name": "timeRecordEvent",
"kind": "collection"
}
]
}