Understanding and Customizing Duplicate Timecard Detection

Ashish Kumar SI
Tera Contributor

When duplicate timecards are detected in ServiceNow, the system provides a warning and allows merging them unless they are in Processed, Approved, or Recalled states. Duplicate detection works by comparing values in key fields like:

  • Short Description
  • State
  • Task
  • Category
  • Rate Type
  • Resource Plan
  • Project Time Category

How to Check and Modify Duplicate Detection Logic:

  1. Review the Logic:
    The duplicate detection logic is implemented in the "TimeCardPortalService" Script Include. Specifically, look for the "mergeDuplicateTc" function. This function handles the identification and merging of duplicate timecards.

  2. Customize the Criteria:
    If you need to add a new field (e.g., a custom choice field) to the detection criteria:

    • Open the "mergeDuplicateTc" function in the "TimeCardPortalService" Script Include.
    • Add the new field to the comparison logic. For example, include checks for the field's value alongside the existing fields.
    • Ensure that the field is optimized for performance, as this process could run frequently.
  3. Test Your Changes:
    After making updates to the script, test the modified logic in a development or test environment to ensure it works as expected and doesn’t introduce performance issues.

By understanding and modifying the "TimeCardPortalService" Script Include, you can customize the duplicate timecard detection process to better suit your organization's needs. This approach allows you to expand the criteria as necessary while maintaining system functionality.

0 REPLIES 0