Need dynamic select option in childtable

on refresh parent doctype i want dynamic select option for childtable like this

if(childtable_row.financier == "test"){
status.options = ["A",'B']
}else{
status.options = ['c']
}

Hi @pratikcws,

  if(row.financier == "TEST")
  {
    set_field_options("status", ["Loan Approved","Loan Appealing"])
  }
  else
  {
    set_field_options("status", ["Loan Accepted"])
  }

And More details of script: Filter Options in Select Field
https://docs.erpnext.com/docs/v12/user/manual/en/customize-erpnext/custom-scripts/filter-options-in-select-field

Thank You!

this will work for parent doc but not for child table

Hi @pratikcws,

If you have not check so check it for just small help.

and you have a find any solution then put in this topic.

Thank You!

Hi @pratikcws,

I got a solution.

Please check it.
it works for my side in child table.

if(row.financier == "TEST")
    {
        frm.fields_dict.items.grid.update_docfield_property("status","options",["Loan Approved","Loan Appealing"]);
    }
else
    {
        frm.fields_dict.items.grid.update_docfield_property("status","options",["Loan Accepted"]);
    }

Thank You!

Which version of ERPNext is it working for?

12 and 13 both.

I am getting the following error:

frm.fields_dict.items.grid.update_docfield_property is not a function
at refresh (eval at setup (script_manager.js:160:5), :30:39)
at a (script_manager.js:90:16)
at script_manager.js:108:22