How can the document name be created automatically according to a logic?

You want to create the document name automatically according to a specific convention.

You can generate the document name automatically from database values. Proceed as follows:

The document name should be defined from the contact's surname and a date, for example. To do this, name the document name of your template as follows:

[contact.lastname]-[CurrentYear][CurrentMonth][CurrentDay][CurrentTimestamp]