1c 8.2 number is not unique. The value of the "Code" ("Number") field is not unique. How to prevent the "Code is not unique" error

What to do if, when creating infobase objects, the error “The value of the“ Code ”field is not unique” (for documents - the value of the “Number” field)?



This is usually due to the fact that the code of the edited reference book (document number) was manually edited incorrectly.

Let's consider an example for clarity. For a reference book, the admissible code length is 9 characters. The elements “000000001”, “000000002”, ..., “000000086” were created in the reference book and numbered in a standard way. If, for example, the number "90" is specified in the next element, then the program, firstly, will automatically complete the specified number on the right with spaces up to 9 characters (it will turn out "90_______" - 7 spaces on the right), and secondly, it will "understand" the new way of numbering and assigns codes "91_______", "92_______", etc. to the following elements. (the same 7 spaces on the right). After writing an element with the code "99_______", subsequent automatic numbering will be impossible, since the next number generated according to this rule ("100_______") will not fit into the valid 9 characters.

To eliminate the error, you need to use the processing "UniversalSelections andProcessingObjects" (can be found on the ITS disk).


In the field "Search object" you must specify the desired object (reference / document). On the tab "Selection by attribute values" you can select (in our case, set the selection by code):


When you click the "Find objects" button, the "Found objects" tab will be filled with objects that meet the selection criteria:


On the "Processing" tab, select the "Renumber objects" processing. The processing header indicates the name of the setting and the starting number from which the numbering will be performed. Processing is started by pressing the "Execute" button.


After processing is complete, you can check the modified code in the Residents directory, and add new entries for verification.

Most often, this error occurs when working directly with directories of contracts, counterparties, nomenclature, etc. The user adds a new record to any of the directories, and the system automatically assigns a code to it, but when the record is saved, it gives the error "Code is not unique!" and, therefore, the object cannot be saved.

What is the reason for this error?

And the reason may be the incorrect numbering of the reference book objects. How does this happen? Usually, when creating a new record in one of the directories, the program itself generates the record code. If in previous records the user edited the code manually, then later there is a possibility that when creating subsequent records, the bit depth of the code will increase by one character and cease to fit in the field, which means that the generation of codes will start over. Only now it is impossible to store objects with the same codes in 1C directories, which means that the user in such a situation will receive an error message on the screen.

How to fix the "Code is not unique" error?

Of course, the solution to this problem is provided by the developers of 1C. It consists in the complete renumbering of the directory elements. To do this, there is a special processing on the 1C () information technology support disk, which is called "UniversalSelecting and ProcessingObjects.epf". It is located in the \\ 1CITS \\ EXE \\ ExtReps \\ UNIREPS81 \\ UniversalSelection directory.

All the user needs to do is to enter the above directory, start processing and wait until the process of renumbering the objects of the selected directory is completed.

How can I prevent the "Code is not unique" error?

To prevent the appearance of this error when working with 1C directories, first of all, it is not recommended to manually edit the entry codes. It is the interference with the program numbering that most often leads to its occurrence. If you cannot do without editing the codes, then think about the situation in advance.

What to do if, when creating infobase objects, the error “The value of the“ Code ”field is not unique” (for documents - the value of the “Number” field)?



This is usually due to the fact that the code of the edited reference book (document number) was manually edited incorrectly.

Let's consider an example for clarity. For a reference book, the admissible code length is 9 characters. The elements “000000001”, “000000002”, ..., “000000086” were created in the reference book and numbered in a standard way. If, for example, the number "90" is specified in the next element, then the program, firstly, will automatically complete the specified number on the right with spaces up to 9 characters (it will turn out "90_______" - 7 spaces on the right), and secondly, it will "understand" the new way of numbering and assigns codes "91_______", "92_______", etc. to the following elements. (the same 7 spaces on the right). After writing an element with the code "99_______", subsequent automatic numbering will be impossible, since the next number generated according to this rule ("100_______") will not fit into the valid 9 characters.

To eliminate the error, you need to use the processing "UniversalSelections andProcessingObjects" (can be found on the ITS disk).


In the field "Search object" you must specify the desired object (reference / document). On the tab "Selection by attribute values" you can select (in our case, set the selection by code):


When you click the "Find objects" button, the "Found objects" tab will be filled with objects that meet the selection criteria:


On the "Processing" tab, select the "Renumber objects" processing. The processing header indicates the name of the setting and the starting number from which the numbering will be performed. Processing is started by pressing the "Execute" button.


After processing is complete, you can check the modified code in the Residents directory, and add new entries for verification.

Did you like the article? To share with friends: