Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Unable to create Territory because of issues with Unique ID



Unable to create unique territory ID after SAHC upgrade.

It appears that after the upgrade from SAHC v7.21 to v7.22, the ID associated with territories was set to a value that had already been used. As a result, the create territories is failing with unique key constraint.

It seems the issue would be cleared if the current value were reset to the highest value in use.

Error Messages

No Error messages on the screen. But on the log message and tracer, following error is thrown.
" ** Violation of PRIMARY KEY constraint 'PEGACPM_DATA_SFA_BUSINESSTE_PK'. Cannot insert duplicate key in object 'dbo.crm_data_businessterritory'. The duplicate key value is (PEGACRM-DATA-SFA-BUSINESSTERRITORY BT1009). "

Steps to Reproduce

  1. Go to Territory tab from left manu and then
  2. Create territory after entering the required information on the screen

Root Cause

A defect in Pegasystems’ code or rules.


Increase the pyLastReservedID for respective pyPrefix in pc_data_uniqueid table.

Published August 26, 2017 - Updated December 2, 2021

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us