ERPNext Conference 2019* Blog

[Tutorial] set_df_property for child table fields?


How to set property of field in child table?

Ans: We can set property of doc fields using following syntax.

cur_frm.set_df_property(FIELDNAME, Property, Value);


cur_frm.set_df_property("cheque_no", "reqd", doc.voucher_type=="Bank Entry");

We can also set property of fields in child table, which is the main reason for this post.

var df = frappe.meta.get_docfield("TABLE NAME","FIELDNAME",;
df.read_only = 1;


var df = frappe.meta.get_docfield("Employer Project Details","company_name",;
df.options = ["Tech M", "Wipro", "TCS"];

Using above code, I have generated dynamic drop-down in child table field of Select type.



How to add different values for each select dropdown options for different rows of a table
Hiding some fields in doctype based on User

Hi @kolate_sambhaji,

How can i change currency in child table as following image?

before it worked
cur_frm.set_df_property(“field_name”,“default”, “MMK”);refresh_field(“field_name”);


I think if you choose currency as type fetch it automatiqually.



To change doc field use following script.

cur_frm.set_df_property(“total”, “fieldtype”, “Currency”);

also for table files use script
var df = frappe.meta.get_docfield(“Table Doctype Name”,“FIELDNAME”,;
df. fieldtype = “Currency”;

If you want to change precision, then from system setting you can change precision.


Thanks @kolate_sambhaji. Your code is to change field type.

How can I change default currency?
Ex: total_claimed_amount, field type is Currency and USD as default. I want to change it depend on currency I choose.
Value $ 800, if you choose currency MMK, it will change to MMK 800.

before it worked
cur_frm.set_df_property(“total_claimed_amount”,“default”, “MMK”);


yes, in Sales Order has multi currency which the currency in the table change based on Currency selection automatically.

In my case, I try to customize Expense Claim to have multi currency.

Hide field using python

Hi @kolate_sambhaji,

I did what you said, finally i figure out there is something you mentioned wrongly,

frappe.meta.get_docfield(“TABLE Doctype NAME”,“FIELDNAME”,;

Shouldn’t be TABLE Doctype NAME => LINK DOCTYPE NAME (Table option link name) , i tried the code which make me always hit error if i include Table Name… work fine when i put Link Doctype Name~


Thanks for providing the information, but how can I push different option values in different rows.


@Deep Did you figure out how to push different option values in different rows? I am also trying it out.