Domain separation for Number and Counter tables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2025 12:01 PM
Hello everyone,
I'm working on customizing the sys_number and sys_number_counter tables to support domain-specific number generation in a multi-domain environment. The goal is to add a domain field to these tables so that unique numbering sequences can be maintained for each domain.
What I Did
- Added a domain reference field to the sys_number and sys_number_counter tables.
- Attempted to create a record in the tables to include the domain field when generating numbers for records in domain-separated tables.
Issue
Can't create the records, I encountered the following error:
(conn=2327933) Duplicate entry 'change_request' for key 'table'
This happens even though the domain field is part of the record being processed. It seems like the table field is being treated as the unique key, causing conflicts when multiple domains attempt to generate numbers for the same table.
Attempts to Resolve
- Verified the unique constraints on the sys_number and sys_number_counter tables.
- Tried modifying the unique index to include the domain field alongside the table field. However, I'm concerned this might break system functionality or existing data integrity
Question
How can I safely add domain-specific functionality to the sys_number and sys_number_counter tables without encountering duplicate entry errors? Is there a best practice for achieving this in a multi-domain environment?
Any guidance, suggestions, or shared experiences would be greatly appreciated. Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 11:20 AM
Found the following KB related to the question: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0863040
For question -> Do we have separate Number maintenance theory for Domain separated instance , the answer is no.
Number is not generated differently nor based on the domain we are logged in.