Title the document

Hello;

I need to name (title) the document using multiple fields, for example to be:
customer_name-source-destination
Where customer_name and source and destination are all fields.
Is there settings for this or I have to write script?
If I have to write script, then I have to use validate in python?
Appreciate if there is example.
Regards
Bilal

Hello Bilal,

This is very much configurable using Document Title field. You can configure it from Customize Form itself. For the reference, you can also check Document Title for the existing doctypes like Sales Invoice.

https://erpnext.org/docs/user/manual/en/customize-erpnext/document-title

Yes and I found another method which is using the validate method in the .py file and I can set the name by using self.title as in the below code:

def validate(self):
self.title = self.customer + “-” + self.origination_place + “-” + self.final_destination

Regards
Bilal