Skip to Content
Technical Articles
Author's profile photo jaideep shetty

Automatic Termination – Contract End Date

Requirement

The employee should be terminated when the contract end date is expired. Contract end date field is in the job information section of the employee profile.

Options explored

Off cycle batch event – can’t use when more than one entity are involved.
Integration center – success.

Solution

The solution is developed using Integration center.

1. Create – More Integration type – select the parameters as below

Integration%20Type%20Parameters

Integration Type Parameters

2. Select the Job Information entity and click Next.

Source%20Entity

Source Entity

3. Give you integration a name and descriptionName%20and%20Description

Name and Description

4. Switch to field mapping view

Mapping%20view

Mapping view

5. Select the Job Information Entity in the Destination section and click delete.

 

6. Click Add in the destination section and select empEmploymentTermination object as show below

Destination%20Entity

Destination Entity

7. Map the fields from source entity Job Information to Employment Termination entity in the destination section whose values should be dynamically derived.

In my case, below are the field mappings.

User ID – User ID (Job Information)
Person ID External –personIdExternal (userNav/empInfo)
Exit Date – Contract End Date (Job Information)
Last Date of Work – Contract End Date (Job Information)
Last Date of Payment – Contract End Date (Job Information)

Field%20mappings

Field%20mappings

Field mappings

8. Hard code the static value fields by switching to detail view and clicking on the More field options as how in screenshots below.

Fields hard coded in my case
Event Reason – TER_IEND (this is the event reason code for termination – end of contract)
Ok To Rehire – True
Local event reason(custom field) – End of Contract

Value%20mappings

Value mappings

9. Filter and sort

Use advanced filters as per your requirement.
Below you can notice that I have set the filter to consider all records whose contract end date is before today and employee status is active.

Filter%20and%20Sort

Filter and Sort

FYI – Below is the status field to check employee status. userNav/Status = t is the filter to fetch all the active employees.

User%20Status%20Field

User Status Field

Conclusion

This integration program can be scheduled daily to fetch all the employees whose contract end date has expired and upsert the termination details into the employment details entity.
As soon as the employment details entity is updated with termination details, the system automatically creates a record in job information section with the termination event reason designed in this integration field mapping.

Hope this helps.
Thank you.

Assigned Tags

      6 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Nathan Wilkinson
      Nathan Wilkinson

      An interesting blog - Can i ask why you would not use the 'Hire Fixed Term contractor' to do this for you?  Having the future dated termination date also means they employee coulid be classified as a functional user if their LOS is less than 12 months.

      Author's profile photo jaideep shetty
      jaideep shetty
      Blog Post Author

      Hi Nathan,

      Thank you.

      This solution is for the scenarios where the contract is not fixed and there is a possibility that employees contract end date will be extended or employee will be converted from fixed contractor to permanent.

      Hence users do not want the termination event be created from the get go.

       

      Author's profile photo Nathan Wilkinson
      Nathan Wilkinson

      Thanks - So the integration centre job will run when the contract end date =today and automatically create the termination record?  Almost as a failsafe?

      Author's profile photo jaideep shetty
      jaideep shetty
      Blog Post Author

      Yes Nathan.

      You can set the condition as per requirement, it can be contract end date == today or contract end date < today.

       

      Author's profile photo Harold Yrureta
      Harold Yrureta

      Hi jaideep

       

      Very interesting blog. I've tried to replicate this integration but I'm getting an "unkown error when import, please contact your administrator".

      Would you know what could be causing this issue?

       

      Hope to hear from you.

       

      Kind regards.

      Author's profile photo jaideep shetty
      jaideep shetty
      Blog Post Author

      Hi Harold,

       

      The error looks more generic. Can you give me some more details?

      Thanks