Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Tasks built in related table task_time_worked do not allow any task or time worked to be saved if the related records are added before the main record save - Known Error
  • >
  • Knowledge Base
  • >
  • Known Error (Knowledge Base)
  • >
  • Tasks built in related table task_time_worked do not allow any task or time worked to be saved if the related records are added before the main record save
KB0529899

Tasks built in related table task_time_worked do not allow any task or time worked to be saved if the related records are added before the main record save


866 Views Last updated : Apr 7, 2024 public Copy Permalink
KB Summary by Now Assist

Description

When inserting a record into the Time Worked embedded list prior to submitting the record, a unique key violation occurs and the record cannot be submitted. This error only occurs when the com.snc.time_worked.update_task_timer property is set to True.

The error is:

Unique Key violation detected by database (Duplicate entry 'sys_id' for key 'PRIMARY')
Invalid insert

Steps to Reproduce

  1. Navigate to System Properties > All Properties.
  2. Search for com.snc.time_worked.update_task_timer.
  3. Set Value to true.
  4. Navigate to Incident > Create New.
  5. Right-click on the header and select Personalize > Form layout.
  6. Add Time Worked->Task from Available to Selected.
  7. Click Save.
    The Incident form should open.
  8. In the Time Worked embedded list, click Insert a new row and enter any value.
    Ensure that you have not saved the incident record.
  9. Right click on the header and select Save.
    The unique key violation error occurs and your record is not submitted.

Workaround

This is expected behaviour when a business rule on the Task Time Worked table is set as a "Before" rule. Changing it to an "After" rule makes the violation disappear. Creating a related record before creating the current one gives this error, in case there is a before business rule on the related record.

 


Related Problem: PRB590991

The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.