Initialize DocType from another DocType Field

I have DocType A with Field X ( link to Customer )…

From DocType A i want create a new DocType B and read Field X and initialize Fields on DocType B ( Name, Street Country and so on )

Should I create an action for this and solve this by code ?

On the other hand if the Customer changes Values on DocType B => the Customer where linked must be updated after submitting DocType B.

i am happy for ideas or suggestions on how to solve this