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.
Customer_account.account_code default value is not generated correctly and throwing error - java.sql.BatchUpdateException: Duplicate entry for key account_path - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • Customer_account.account_code default value is not generated correctly and throwing error - java.sql.BatchUpdateException: Duplicate entry for key account_path
KB0783732

Customer_account.account_code default value is not generated correctly and throwing error - java.sql.BatchUpdateException: Duplicate entry for key account_path


2106 Views Last updated : Feb 18, 2025 public Copy Permalink
KB Summary by Now Assist

Issue

Customer_account import is getting lot of error when inserting a new record example - java.sql.BatchUpdateException: Duplicate entry for key account_path

Cause

Not updating the sys property (com.snc.cs_base.last.generated.code.tree.path) with correct value after importing the customer_account data
Records already exist with the provided value in the sys property (do a query on account_code with that value) Refer : Create customer and consumer information
The value in sys property (com.snc.cs_base.last.generated.code.tree.path) went out of sync with the records in customer_account

Resolution

Workaround/solution would be :

  1. Update the com.snc.cs_base.last.generated.code.tree.path sys_property with the correct value
  2. You can get the value by sorting the record list in descending order based on account_code and the first record will be the one with higher lexical order
  3. So, To get the latest code that is generated :
  4. Go to accounts
  5. Add Account Code field in the list view
  6. Sort the list in descending order based on "Account Code" Field
  7. The account code of the first record is the last generated code


* More Details :
* How new account code gets generated - account_code is generated based on the pattern "!#$&()*+,-.0123456789:;<?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]`}|{~" and sys_property com.snc.cs_base.last.generated.code.tree.path
For e.g.: if value in sys_property is !!!#, the next value for account code will be !!!$.


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.