Field Name of the Custom Field does not fetch from mysql


I have observed a situation here:

Created a field in a document ABC, now the field name of the field was automatically named “abc”.

Now after making the field I realised that the field name was wrong so I changed the field name at the mysql level from “abc” to “xyz”

Now the actual field name in the database is xyz but the field name being shown in the custom field list, and I presume, in the customize form view is being shown as the old “abc”.

Is this kind of behaviour along expected lines.

Yes! Always change changed database via Frappe…

You can create a new Custom Field with XYZ - it will map to your existing field.

So what should I do if I have already renamed a field via mysql.

Is there a way I can update the changes on the erpnext via frappe command.

hello everyone,
Can u please suggest me if i change the field name direct from model’s .json file then than i’ll change database manually or can i change via terminal because my field name of in the database is different from my .json file


If you want to change via the json file, you have to change the "modifed" timestamp in the json file.

Recommended way is to edit the DocType via the UI with developer_mode as 1

Is any command via terminal for this

bench frappe —latest

I just renamed a field by logging into mysql using the following command:

ALTER TABLE tabSupplier CHANGE tin_number tin_no VARCHAR(255);

The change has been done successfully at the mysql level but the supplier form shows the field as blank only. I have already run the command bench frappe --latest [sitename] but the changes are not getting reflected.

Is there any thing that I am missing?

I have tried this command but this doesn’t work database doesn’t update automatically

frappe --latest will sync your tables with the .json files

If you have changed a custom field, just rename it or create a new one! The data will be automatically mapped.

Renaming a custom field is not available as an option and hence we can only delete and create a new custom field by the same name.

Anyhow this resolved my issue. Thanks a lot for the help.