Leave History Fetch from child table in Leave application

Hi,
I have added one child table in leave application.

Child table Label: History & Field name: custom_history (In leave application).
Child Table fields: start_date, end_date, rejoining_date, days_taken.

My query :
If i create new leave application for one employee, then the leave history, I mean the history child table old records should fetch automatically on the new application child table.
For example, 1st I created one leave application and added one row in the child table. Then, Im going to create new application for same employee, so based on employee selection, the child table record should appear automatically in that new Leave application.

please suggest any reference code !!!

Please check the reference: Fetch Child table form one doctype to other doctype - #6 by NCP

But, I want the child table data fetching from old leave application to New Application.

Concept is same but you have to apply the logic.

Is this function done by only with client script? Or Server script is must?

If you are able to retrieve the old leave application using client script, you can handle everything on the client side. If unsuccessful, you will need to implement a logic on the server side.