How can I use multiple fields for a title?

I’ve been running around in circles how to concatenate two fields together for use in the title of a doc. All I’m trying to do is get field first_name, and field last_name to look like, say first_name is “jon”, last_name is “doe” I want the resulting title to be “jon doe”. how can I do this?

Into the options of the title field put

{first_name} {last_name}


Can title be a hidden object?

By default it is hidden property, why do you ask ‘Can’?

Hi @max_morais_dmm

Just tried this in V13 but it returns an “Invalid Data Field” error

Any other suggestions pls?

1 Like

When I put it in the options, I have the error:
Title is an invalid Data field.

Only Options allowed for Data field are:

* Email
* Name
* Phone
* Barcode

I have same problem, like author

Do you find solution?

I need help with that.

Still doesn’t work as far as I’m aware. You may need to resort to Custom Scripts

1 Like

I need just title in format like this
{last_name} {first_name}
howto create Custom Script for it?

Try this. Make Title field as Data fieldtype and include this in your .py file.

def validate(self):
        self.title= ' '.join(filter(None, [self.last_name, self.first_name]))
1 Like

Thanks, but will it works after erpnext update? Or Should I insert it something else?

Can I use it through app/server-script ?
Or how to do it and save update erpnext?

{fieldname} in option or default not working for v13. The documentation needs update.