New docfields fixed in doctype

Hi,

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

Example:

Title
Caption
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

Hi,

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

Hi,

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:

2 Likes

:rofl:

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.

:crazy_face: