/
DCR - Employment Hero - Time Sheet Sync

DCR - Employment Hero - Time Sheet Sync

SUMMARY

Time Sheet Records are created in Salesforce based on a configured scheduled process which runs each week or fortnight or month. This configuration can be access via the Time Sheet Settings option in the Setup Menu.

Time Sheets are currently scheduled to generate on Monday mornings.

Generated Time Sheets have Time Sheet Entry Records associated to them when workers complete a Service Appointment. Time Sheet Entry Records are usually auto generated based on the employee checking in and checking out of their appointment.

On Sunday night at 10 PM a scheduled process runs in Salesforce to sync the Time Sheets with their related Time Sheet Entries to Employment Hero. When the sync is complete, the Time Sheet Entry Records will be available in Employment Hero for approval.


Salesforce Finance Users can also sync Time Sheet Records individually from Salesforce.

From a Service Resource Record you will be able to see related Time Sheet Records.

The Contact Field on the Service Resource should be populated with a Contact who has been synced to Employment Hero, this is where we retrieve the Payroll ID of the employee to accurately assign the Time Sheet Records in Employment Hero.

Clicking into the Time Sheet Record you will see a EH Sync quick action at the top of page. Clicking this button will attempt to sync the Time Sheet to Employment Hero, the result will be returned in the EH Sync Status and EH Sync Details fields.

This process will fail if there are no related Time Sheet Entry Records related to the Time Sheet.

Clicking into the Time Sheet Entry Record, you will see sync details for each individual Time Sheet Entry as well, with the ability to sync to Employment Hero via the EH Sync quick action.


TECHNICAL SPECIFICATION

From a Time Sheet and Time Sheet Entry record in Salesforce we will trigger the creation of Time Sheet and Time Sheet Entry records in Employment Hero through the KeyPay API.

A summary of the Time Sheet data services can be found here - https://api.keypay.com.au/australia/reference/timesheets

We will use the following methods:

Method

HTTP Request

Description

Method

HTTP Request

Description

Bulk Insert Timesheets

POST /api/v2/business/{businessId}/timesheet/bulk

When a Time Sheet is created in Salesforce, we will trigger the creation of the Time Sheet in Employment Hero.

Time Sheets get created in Salesforce via a scheduled service (see Time Sheet Settings in the Setup Menu) where Time Sheets for all 400-500 workers will be created.

We can run a Bulk Insert Time Sheets scheduled service after the Time Sheet creation service is run in Salesforce and trigger individual Time Sheet creation for any records that are created outside this service.

Create timesheet line

POST /api/v2/business/{businessId}/timesheet

When a TimeSheetEntry is updated or created with Status = 'Approved', then trigger the Time Sheet Line to be created in Employment Hero.

Delete timesheet line

DELETE /api/v2/business/{businessId}/timesheet/{timesheetLineId}

If a TimeSheetEntry is deleted in Salesforce, then delete the Time Sheet Line in Employment Hero.

Update timesheet line

PUT /api/v2/business/{businessId}/timesheet/{timesheetLineId}

If a TimeSheetEntry is updated in Salesforce, then update the Time Sheet Line in Employment Hero.

Update/Replace timesheets

PUT /api/v2/business/{businessId}/timesheet/bulk

If a TimeSheet is updated in Salesforce, then update the Time Sheet in Employment Hero.

TIME SHEET MAPPING

https://api.keypay.com.au/australia/reference/timesheets/au-timesheet--post?v=latest

Method

HTTP Request

Description

Method

HTTP Request

Description

Bulk Insert Timesheets

POST /api/v2/business/{businessId}/timesheet/bulk

When a Time Sheet is created in Salesforce, we will trigger the creation of the Time Sheet in Employment Hero.

Time Sheets get created in Salesforce via a scheduled service (see Time Sheet Settings in the Setup Menu) where Time Sheets for all 400-500 workers will be created.

We can run a Bulk Insert Time Sheets scheduled service after the Time Sheet creation service is run in Salesforce and trigger individual Time Sheet creation for any records that are created outside this service.

Create timesheet line

POST /api/v2/business/{businessId}/timesheet

When a TimeSheetEntry is updated or created with Status = 'Approved', then trigger the Time Sheet Line to be created in Employment Hero.

Delete timesheet line

DELETE /api/v2/business/{businessId}/timesheet/{timesheetLineId}

If a TimeSheetEntry is deleted in Salesforce, then delete the Time Sheet Line in Employment Hero.

Update timesheet line

PUT /api/v2/business/{businessId}/timesheet/{timesheetLineId}

If a TimeSheetEntry is updated in Salesforce, then update the Time Sheet Line in Employment Hero.

Update/Replace timesheets

PUT /api/v2/business/{businessId}/timesheet/bulk

If a TimeSheet is updated in Salesforce, then update the Time Sheet in Employment Hero.

TIME SHEET MAPPING

https://api.keypay.com.au/australia/reference/timesheets/au-timesheet--post?v=latest

Employment Hero

Salesforce

Notes

Employment Hero

Salesforce

Notes

approved

 

Set to true.

Not sure what this does.

employeeIdType

 

Set to Standard.

Not sure what this does.

fromDate

TimeSheet.StartDate

TimeSheets created from the scheduled service will all have the same date.

locationIdType

 

Set to Standard.

Not sure what this does.

replaceExisting

 

Set to false.

Assuming this will always be false on creation.

returnResponse

 

Set to true.

Assuming this returns a response to Salesforce which we can capture on a TimeSheet record.

timesheets: attachment

 

DO NOT MAP

timesheets: attachmentId

 

DO NOT MAP

timesheets: breaks

 

DO NOT MAP

timesheets: classificationId

 

DO NOT MAP

timesheets: comments

 

DO NOT MAP

timesheets: employeeId

ServiceResourceId.Contact__c.Employment_Hero_ID__c

 

timesheets: endTime

TimeSheet.EndDate

 

timesheets: externalId

TimeSheet.Id

 

timesheets: fullyQualifiedLocationName

 

DO NOT MAP

timesheets: hiddenComments

 

DO NOT MAP

timesheets: id

 

Assuming this is system generated, maybe only needed for updates?

timesheets: leaveCategoryId

 

DO NOT MAP

timesheets: rate

 

DO NOT MAP

timesheets: shiftConditionIds

 

DO NOT MAP

timesheets: shiftConditions

 

DO NOT MAP

timesheets: source

 

DO NOT MAP

timesheets: startTime

TimeSheet.StartDate

 

timesheets: status

TimeSheet.Status

 

timesheets: submittedByUser

ServiceResourceId.Contact__c.Employment_Hero_ID__c

 

timesheets: units

 

DO NOT MAP

timesheets: workType

 

DO NOT MAP

timesheets: workTypeId

 

DO NOT MAP

TIME SHEET ENTRY MAPPING

https://api.keypay.com.au/australia/reference/timesheets/au-timesheet--post-individual?v=latest

Employment Hero

Salesforce

Notes

Employment Hero

Salesforce

Notes

classification

 

DO NOT MAP

classificationId

 

DO NOT MAP

comments

TimeSheet.Description

 

employeeId

TimeSheet.ServiceResourceId.Contact__c.Employment_Hero_ID__c

 

endTime

TimeSheetEntry.EndTime

 

externalId

TimeSheetEntry.Id

 

fullyQualifiedLocationName

 

DO NOT MAP

hiddenComments

 

DO NOT MAP

id

 

Assuming this is system generated, maybe only needed for updates?

leaveCategoryId

 

DO NOT MAP

locationId

 

DO NOT MAP

locationIdDeleted

 

DO NOT MAP

payCategoryId

 

DO NOT MAP

rate

 

DO NOT MAP

shiftConditionIds

 

DO NOT MAP

shiftConditions

 

DO NOT MAP

source

 

"Salesforce"

startTime

TimeSheetEntry.StartTime

 

status

TimeSheetEntry.Status

 

units

TimeSheetEntry.EndTime - TimeSheetEntry.StartTime

Create new formula field.

workType

Service_Appointment__r.WorkOrder.WorkType

 

workTypeId

Service_Appointment__r.WorkOrder.WorkType.Employment_Hero_Code__c

 

Related content

Employment Hero - Time Sheet Sync
Employment Hero - Time Sheet Sync
More like this
DCR - Employment Hero - Employee Sync
DCR - Employment Hero - Employee Sync
More like this
Keypay/Employment Hero Integration
Keypay/Employment Hero Integration
More like this
Employment Hero - Employee Sync
Employment Hero - Employee Sync
More like this
DCR - Time Sheet Management
DCR - Time Sheet Management
More like this