How to set up smartphones and PCs. Informational portal
  • home
  • Safety
  • The user field value is not unique 1s. The value of the "Code" ("Number") field is not unique

The user field value is not unique 1s. The value of the "Code" ("Number") field is not unique

What should I do if, when creating infobase objects, I encounter 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 directory (document number) was incorrectly edited manually.

Let's look at an example for clarity. For a certain directory, the permissible code length is 9 characters. In the directory, the elements “000000001”, “000000002”, ..., “000000086” were created and numbered in a standard way. If you specify, for example, the number “90” in the next element, then the program, firstly, will automatically supplement the specified number on the right with spaces up to 9 characters (you get “90_______” - 7 spaces on the right), and secondly, it will “understand” the new numbering method and will assign codes “91_______”, “92_______”, etc. to the following elements. (same 7 spaces on the right). After recording an element with the code “99_______”, subsequent automatic numbering will not be possible, since the next number generated according to this rule (“100_______”) will not fit into the allowed 9 characters.

To eliminate the error, you must use the “Universal Collections and Objects Processing” processing (can be found on the ITS disk).


In the “Search object” field, you must specify the desired object (directory/document). On the “Selection by detail values” tab, you can perform a selection (in our case, we will set the selection by code):


When you click the “Find objects” button, the “Found objects” tab will be filled with objects that satisfy the selection conditions:


On the “Processings” tab, you must select the “Renumbering of objects” processing. The processing header indicates the name of the setting and the starting number from which numbering will be performed. Processing is started by clicking the “Run” button.


After processing is complete, you can check the changed code in the “Residents” directory, as well as add new entries for verification.

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

What is the reason for this error?

And the reason may be incorrect numbering of directory objects. How does this happen? Usually, when creating a new entry in one of the directories, the program itself generates the entry code. If in previous records the user edited the code manually, then there is a possibility that when creating subsequent records the code width will increase by one character and will no longer fit in the field, which means that code generation will start all over again. But it’s 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 1C developers. It consists of a complete renumbering of the directory elements. For this purpose, there is a special processing on the 1C information technology support disk () called “Universal Selection and Processing of Objects.epf”. It is located in the \1CITS\EXE\ExtReps\UNIREPS81\UniversalSelection directory.

All that is required from the user is to go to the above directory, start processing and wait until the process of renumbering the objects of the selected directory is completed.

How to prevent the “Code is not unique” error from appearing?

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

What should I do if, when creating infobase objects, I encounter 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 directory (document number) was incorrectly edited manually.

Let's look at an example for clarity. For a certain directory, the permissible code length is 9 characters. In the directory, the elements “000000001”, “000000002”, ..., “000000086” were created and numbered in a standard way. If you specify, for example, the number “90” in the next element, then the program, firstly, will automatically supplement the specified number on the right with spaces up to 9 characters (you get “90_______” - 7 spaces on the right), and secondly, it will “understand” the new numbering method and will assign codes “91_______”, “92_______”, etc. to the following elements. (same 7 spaces on the right). After recording an element with the code “99_______”, subsequent automatic numbering will not be possible, since the next number generated according to this rule (“100_______”) will not fit into the allowed 9 characters.

To eliminate the error, you must use the “Universal Collections and Objects Processing” processing (can be found on the ITS disk).


In the “Search object” field, you must specify the desired object (directory/document). On the “Selection by detail values” tab, you can perform a selection (in our case, we will set the selection by code):


When you click the “Find objects” button, the “Found objects” tab will be filled with objects that satisfy the selection conditions:


On the “Processings” tab, you must select the “Renumbering of objects” processing. The processing header indicates the name of the setting and the starting number from which numbering will be performed. Processing is started by clicking the “Run” button.


After processing is complete, you can check the changed code in the “Residents” directory, as well as add new entries for verification.

Best articles on the topic