Using custom script filter childtable

Hi,
I’m trying to use custom script to filter child table to get only record that in current DocType record only.

Can anyone help me?