---
title: "Auto-numbering & composite Code Format (Stock Items)"
canonical: "https://wiki.soft1.eu/space/SS5EN/243630436/Auto-numbering%20%26%20composite%20Code%20Format%20(Stock%20Items)"
format: markdown
---
Assuming that DEMO SA company wishes, due to archiving and organizational requirements, when posting a new Item, the next available code in ascending order to be suggested/ generated along with a distinctive element of the Stock Item. Besides the auto-numbering, which will hold the four last places (10-13), the first **digits** of the **Comm. Category** abbreviation shall hold places 1 and 2. The first **digits** of the **Business Unit** abbreviation shall hold places 4 and 5 and finally, the first **letters **of the** Country of origin **abbreviation shall hold places 7 and 8, e.g. 10-10-EL-0000.

**Configuration**  
Regarding auto-numbering with code format, where the abbreviation of elements, which belong to the Item's profile card, will be included (e.g. Commercial Category, Business Unit, Country of Origin), proceed as follows:

- specify the suitable **Code Format **e.g. NN-NN-LL-NNNn, as displayed at the following screen,
- click on the hyperlink:
  - fill in the **From, To **fields (by setting the range),
  - fill in the **Formula **field (apply drag & drop or double-click on the Item's fields or type the preferable command e.g. RunSQL('select shortcut from country where country=' +String(ITEM.COUNTRY)) and
  - **activate** the **Auto-Numbering **parameter.

<u>*Tip: Use SOFT1 ERP functions and SQL commands at Formula section in order to get the preferable results.*</u>

Finally, click <**Accept**> and then <**Save**>. 

> ℹ️ To activate the general parameters features, you should re-open the respective Entity (Stock Items, Trading Parties etc).

Once the configuration is completed, open the Stock Item List to post the first Item. At first, the "??-??-??-*" code format is suggested, which will be gradually filled in as the user defines/ selects the Stock Item's preferable fields. Finally, fill in manually the code, which indicates the beginning of the auto-numbering. From now on, the next available code shall be suggested. 


![code_format_en520_06.jpg](media://c1422f00-de98-4ffe-a24a-1fd528ced1df)