Course Content
Naming
Faris Ansari
May 19, 2021

If you created a document with the Form, you might have noticed that the name value of the document was a randomly generated hash. Let's make a change so that the Article Name we provide becomes the name of the document.

To do that, open the doctype list from the search bar and click on Article. Now, scroll down to the Naming section and in the Auto Name field enter field:article_name. Click on Save.

Now, go back to the Article List and create a new article again.

Article Naming

Now, the name of the document will be the Article Name and it must be unique across Articles. So you cannot create another article with the same name.

You can also check the database records by running a select query in the mariadb console.

MariaDB [_ad03fa1a016ca1c4]> select * from tabArticle;
+------------+----------------------------+----------------------------+---------------+---------------+-----------+--------+-------
| name       | creation                   | modified                   | modified_by   | owner         | docstatus | parent | parent
+------------+----------------------------+----------------------------+---------------+---------------+-----------+--------+-------
| bd514646b9 | 2020-10-10 16:24:43.033457 | 2020-10-10 16:24:43.033457 | Administrator | Administrator |         0 | NULL   | NULL
| Catch 22   | 2020-10-10 16:41:49.734499 | 2020-10-10 16:41:49.734499 | Administrator | Administrator |         0 | NULL   | NULL
+------------+----------------------------+----------------------------+---------------+---------------+-----------+--------+-------

Learn more about various types of DocType Naming.

Have a doubt?
Post it here, our mentors will help you out.