How to delete form custom field from the database with linux terminal in erpnext?

please give process for delete form custom field from the database with linux terminal in erpnext with the example of Lead (Form), and Lead Owner (Field Name)

Hi,

You can use the below command:

ALTER TABLE `tabLead`
DROP COLUMN lead_owner;

Please take a backup before running the command.

Thanks,

Result is

Query OK, 0 rows affected (0.023 sec)
Records: 0  Duplicates: 0  Warnings: 0

after starting bench
I See Lead Owner is not delete from erpnext. it’s showing in a form.

Please give further steps if any

Hi,

To delete the Lead Owner from Form, Open the Lead Document, Click on Three Dots and Click Customize.

From the Field List select the Lead Owner Field and delete it. Update the Form.

Thanks,

No this process shows error
Cannot delete standard field. You can hide it if you want

Thanks

1 Like

Hi @nilpatel42,

You cannot delete a standard field directly as it is a built-in system feature. However, you can hide a standard field from Customize form if you don’t want it to be visible on the user interface.

If you have a custom field added to the form then you can delete and hide it from Customize form.

I hope this helps.
Thank You!

I need to have many changes in predefined form that’s why i need to delete more number of standard fields. and also ERPNext not give permission to fully edit those standard field. this problem lead me to take decision for deleting standard fields

please give solution if any

Thanks for your valuable reply

Hi @nilpatel42,

I understand that you may have specific requirements that involve deleting multiple standard fields. However, it is important to note that deleting standard fields can have unwanted results and may affect the functionality and integrity of the system. It disappoints deleting standard fields to ensure data consistency and avoid potential issues with future updates or upgrades.

Instead of deleting standard fields, it is recommended to follow customization guidelines, which allow you to hide, modify, or extend the functionality of existing forms and fields without directly deleting them. By using customization options like Custom Scripts, Custom Fields, and Custom Forms, you can achieve the desired changes while maintaining the stability and compatibility of the system.

Note:
If you want to delete the standard field then please enable the developer mode and then go to the DocType and delete it.
We do not suggest deleting the standard field from any DocType.

Thank You!

1 Like

okayyy, i understand

Thank You So Much.