Populate other columns in child table

My custom app is a list of member and the property he/she has (so it’s a one-to-many relationship):

  • doctype Member:
    • member_name
    • property_table (which is a child table)
  • doctype Property Table which is the child table:
    • property_name_child → is a link to doctype Property
    • property_location_child
  • doctype Property:
    • property_name_master
    • property_location_master

What I want to do is when I select a value in property_name_child, the property_location_child should be auto populated (get data from property_location_master).

I know how to populate the entire child table row with self.append().
And I also know how to fetch data with frm.add_fetch() and fill the data with frm.set_value() for non child table fields.

But I don’t know how to get data based on a column in child table (property_name_child) and put it in another column (property_location_child).

Can anyone kind enough to give the sample code?
Thank you very much.

check this link and update me. this code working or not

1 Like