Updating fields with data from related module field - custom function

Updating fields with data from related module field - custom function

Hi,

In my Deals module, I have the section "Buyer info". The buyer is not the client, but rather an outside investor which is going to buy a house for the client, and then rent it to him.

So, "Buyer info" is used in mail merge to populate promise to purchase documents and other legal documents. I would like to automatically update these fields with data from fields in the custom module "Investor". The "Investor module" is linked to the Deals module by a lookup field "Investor" located in the Deals module.

The workflow would go like this: Once an investor is found, the user updates the lookup field "Investor".

Trigger: Lookup field "Investor" is not empty:
Action: Custom function

I would like a sample function to map for example these following fields:

Street (Investor) --- Street Buyer (Deals)
Name (Investor) --- Name Buyer (Deals)

Could you please provide me a sample function to update multiple fields in that way? Once I understand the syntax, I'll just have to plug in the actual field names by myself (which are in french).

Thank you,

Vincent