New docfields fixed in doctype


I need to create new docfields and have them fixed within the doctype options.


Text field for reading
Create one with mask and character limit

In my case, I will use these fields and others in several forms.

Hi @weldonet,

Based on what you’re asking, here’s what you need to do:

  • Title: Create a new field labeled “Title” and set its type as “Data.”
  • Caption: Also, create another field labeled “Caption” with type “Data.”
  • Text Field with Mask and Character Limit: For this, you might have to do some custom work. You can add a field labeled “Text Field with Mask and Character Limit,” set its type as “Data,” and then use JavaScript to limit characters and apply a mask. Alternatively, you might need to explore other options like custom field types or server-side checks based on your specific needs.

Thank You!

1 Like


My question is where to create these new fields?

Where within the frappe can I make these changes, Client script, server script, or direct to files?

Thank you

If you want to add custom field then please check the below reference:

I hope this helps.

Thank You!

1 Like

@weldonet You can use customize form to do that.

1 Like


That’s what I need, but I’m not using erpnext, I’m using pure frappe.

Possible because customize form is the part of the frappe.

1 Like

I found it, I was looking for it in English, but since I’m using the translation I didn’t find it before.

Thank you

I appreciate the support and patience, I’m new here and I’m learning every day!

I found the customize form, but I still couldn’t figure it out.

I created a field called ZIP Code, indicated the Doctype that it will appear, put it as data, but didn’t find out where I can put it that it will receive a mask 00000-000 and that it has a limit of 9 characters

Hi @weldonet:

Ask this guy, maybe you know him! :joy:

AFAIK, there is no direct method to define a mask (it would be an interesting core feature).

See this thread:

Hope this helps.

1 Like

Post is tightly held @avc :rofl:

Don’t worry @weldonet … It happens to me everyday … made awesome things that I don’t recall later :joy: :joy:



Then I was making a script to mask it, but it is done doctype by docktype.

I was looking for a solution to create a dockfields to make available in the docktype for use in any form.

But even for the custom field it will be docktype by docktype.