Fetch Link Childs

Hello! I made a custom script to fetch Sales Partner from Territory.
Here is the script:

cur_frm.add_fetch(‘territory’,‘default_sales_partner’,‘default_sales_partner’)

The problem is that I want the script to perform like when I select the sales partner manually from the list, so that also the sales commission is fetched.

Any suggestion on what I should add?

Thank you!

@somicoito

you can get required value on fields trigger using frappe.client.get_value or frappe.call
and simply set the result to the field.

e.g. frm.set_value(“fieldname”, field_value);

Check this,

Thank you @Sangram for your help.
Can you please tell me in my case how this should be?
I am not a super expert…