Populate a field based on the lookup on another field from a different module - help needed

Populate a field based on the lookup on another field from a different module - help needed

Hello, 

We have renamed our Potentials field to "Contracts" to reflect our business model. On that module, I have set up a lookup field in "Contracts" to lookup a Product Price from the "Products" module. That is working fine. However, we have a need to then automatically populate the field next to it with the actual price of the product once the Product is selected. 

I've gotten to the stage of making a custom function that can be triggered by a rule and rule trigger once that lookup field is populated, but I cannot figure out the code for this simple lookup. Can you assist? I've attached a screen shot of the page is it helps at all. Thanks!