Link project to serial no

Hi everyone,

When submitting a purchase receipt for unique items, it creates the items in the doctype “Serial No”.

I added fields in the “Serial No” doctype to link the project #, Sales Order # and Customer. I want to automatically fetch that information from the purchase receipt doctype which contains the project #, and from there the “Project” doctype which contains the customer and Sales Order #.

I have been trying for hours and am not able to do this, everytime the fields stay empty. Would someone be able to point me in the right direction on how to do that?

Thank You