How to update database fields in ERPnext

I’m sorry to bother you.

with having confused now, I hope to get your help.

I went to update database fields in frappe, and I have tried some ways but it does not work

1.frappe.db.sql(“select supplier_material_number from tabPurchase Order Item where item_code=‘100224307’”, update={‘supplier_material_number’:‘328576’})

Hi @xu_qian,

What is your use case?

Use customize form to update the label of the field, for more details please check the link


I am sorry not to describe clearly, I want to get through the SQL statement to update the value of the field, because the data have is more, I want to use SQL batch operation.

Wont recommend directly updating via sql. Use the data import tool or bulk update tool instead

1 Like