Auto populate details of child table based on link on ther field

Hi we want to display the details of the default template of payment terms on customer

for example when i insert the default payment terms template it will show the payment terms linked with the current default template.
Just like in sales invoice

is it possible to auto populate the payment terms table.
thank you…

Nevermind got it this script help me