Autonaming.. Is it possible to use multiple fields?

The use of autonaming is pretty brilliant, especially when it comes to adding a series, however, is it possible to use the autonaming field to contain multiple queries?

such as “naming_series - field:task_name”

I’m also curious about how “Title” works into the equation for naming of documents, and besides the document list, where it’s used.

I have, in the past, added a script that would fetch values from the documents field upon saving it, and append those to the title, but it feels a bit dirty (If the document is missing a mandatory field, it will generate the name upon every failed attempt to save too, so the name ends up repeated upon saving properly)


Using a custom script you can add various fields to you doctype name.

Title, only replace the visual aspect of the name of the doctype.

For example, do you manage your customers by the VAT ID, so the VAT ID of one customer is ES-9824343438425, but the customer real name is Sara, and do you like see “Sara” instead of “ES-9824…”, so you only need add the customer name to the title, when you are in the customer list, or in the Sara records, you will see “Sara” not the VAT ID, but when do you select Sara in a Invoice, it will ise the Sara’s VAT ID for the record identification.

It’s clear for you?

You can define a hook in your app that will call the autoname method of your document. here you can set any value to the property. But its best to use the title for this purpose.

Check this:

You can set the title in options property.

Thank you so much guys! I’m very much a rookie when it comes to the custom scripting, but it seems like it’s going well so far. I have found previous threads for beginner questions like this useful in the past, so thanks for all of the help!