Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Human Resources forum / Cannot create a record...
Human Resources forum
Suggested answer

Cannot create a record in Employment detail (HcmEmploymentDetail).

(1) ShareShare
ReportReport
Posted on by 9
Cannot create a record in Employment detail (HcmEmploymentDetail). Employment: 563/198606. The record already exists. 
 
I'm getting this error while terminating an employee and the error is so random and the error won't repeat also for the same employee Also, if i get fast replies to it , it will be so helpful. thanks, in advance. 
  • Suggested answer
    CU05050618-0 Profile Picture
    CU05050618-0 12 on at
    Cannot create a record in Employment detail (HcmEmploymentDetail).

    some possible reasons and solutions for this issue:

    1. Concurrency Issues:

      • Check if there are multiple users or processes trying to terminate the same employee simultaneously. If there is a concurrency issue, you might want to implement a mechanism to handle concurrent requests more effectively.
    2. Database Integrity:

      • Verify the integrity of your database. There could be a chance that the database has become corrupted or inconsistent. Running a database integrity check or restoring from a clean backup might help.
    3. Logging and Debugging:

      • Implement detailed logging and debugging to capture the state and sequence of operations leading up to the error. This can help you identify the root cause of the issue.
    4. Unique Constraints:

      • Check if there are unique constraints or indexes on the fields being used for the termination. It's possible that the termination record is being duplicated due to constraints on certain fields. Ensure that the termination request is not trying to insert duplicate values.
    5. Caching:

      • If your system uses caching, ensure that the cache is cleared or updated after a termination is processed. Cached data might cause conflicts when creating new records.
    6. Transaction Isolation:

      • Verify the transaction isolation level in your database. In some cases, a lower isolation level might lead to anomalies. Consider using a higher isolation level if needed.
    7. Check for Asynchronous Processes:

      • Ensure there are no background or asynchronous processes that might be interfering with the termination process. These processes could be creating the record after the termination is processed.
    8. Consult System Logs:

      • Review system logs for any errors or warnings related to the termination process. This might provide additional insights into what is happening.
    9. Review Code:

      • Review the code responsible for handling terminations. Check for any logical errors or race conditions that might lead to the creation of duplicate records.
    10. Contact Vendor/Support:

      • If you are using a third-party software or a system provided by a vendor, it's advisable to contact their support for assistance. They might be aware of specific issues or have patches/updates to resolve such issues.

    Remember to backup your data before making any significant changes to your system. If the problem persists, you may need to involve your development or system administration team for a more in-depth analysis.

  • Komi Siabi Profile Picture
    Komi Siabi 12,364 Super User on at
    Cannot create a record in Employment detail (HcmEmploymentDetail).
    There are no screenshot added.
     
    Can you confirm the version of FO you are on? is this happening in USMF or on live entity.
  • Suggested answer
    sumanth kumar Profile Picture
    sumanth kumar 9 on at
    Cannot create a record in Employment detail (HcmEmploymentDetail).
    @komi siabi i have crossed checked the employee history and he is not terminated and, but the termination button disables as soon as I get the error message. as u asked i ave attached the error message screen shot 
  • Suggested answer
    Komi Siabi Profile Picture
    Komi Siabi 12,364 Super User on at
    Cannot create a record in Employment detail (HcmEmploymentDetail).
    Hi Kumar, 
     
    The error says such record already exists. You would go to employment history and confirm if the worker isn't already terminated. Moreover I do not expect the terminate button to be enabled on such employee after termination.
     
    Can you tell us the version of the application and share a screenshot of the error?

Helpful resources

Quick Links

Community Spotlight of the Month

Kudos to Mohamed Amine Mahmoudi!

Blog subscriptions now enabled!

Follow your favorite blogs

TechTalk: How Dataverse and Microsoft Fabric powers ...

Explore the latest advancements in data export and integration within ...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 284,876 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,425 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,146

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans