Disable mandatory field for standard field

How to disable a mandatory field of my customer that do not have a customer group

customize customer form and select customer_group field and uncheck mandotory field.

i cant do it because its a standard field

go in doctype and uncheck customer_group field

i tried everything customize form and doctype list at the doctype list i can’t change anything any help ?

1 Like

Have you turned on your developer mood before editing standard doctypes?

bench set-config developer_mode 1
Run this command to enable developer mood,
then try to edit doctype.

Hello,
Same problem i am facing when i remove the mandatory from standard filed it can showing the error like this Not allowed to disable Mandatory for standard fields can any one help me how to fix this .

Thanks

try property setter instead

Can u please tell me in details ,where can i change…

based on the example, you can go to property setting, replace the doctype and field name accordingly

3 Likes

Anybody could do it? Please help.

Is it related to the customer group example? If so, try @szufisher’s suggestion. However, if you’re unsure of using property setter, just hide the filed and set a default value under Customer Group as it would be better.

Whether any have workable solution through customization. I want to use Autoname for most of the docs but can not hide Naming Series in all the docs.

Fundamentally there is no meaning of this feature addition to change from Naming Series to Autoname in default doc types without this flexibility.

Tried the latter solution, it worked. Thanks

We can remove standard field mandatory with client script

frm.set_df_property('contract_terms', 'reqd', 0);

It can able to remove mandatory field in timesheet? Because am unable to hide due to this mandatory field.

So we still can’t disable the DOB and Gender fields for the Employee? The client asked to remove these fields, but it appears I can’t. Any suggestions?

Hello :wave:,

Do one thing make them hidden using the frm.set_df_property inside the custom script file and use the frm.set_value to set the some old date value in that additionally same thing in gender fields.

In summary,
You will make them hidden okay so it will invisible okay. Also set some random value in that so user don’t have to fill them and it will not give any errors regarding the field value is missing or you have to enter some value.

I hope you got what I want to explain you !!

I am assuming you know some basic development of frappe.

1 Like

Hi there! Thanks, that does the trick. I wish that was a more UI-based solution, but I guess it’s tied to some vital core functionality I don’t know.

No it will not give you any problem and you can implement this. Because as you are saying that you don’t want to use those fields that’s why it will be better solution.

1 Like