Copying the fields from one custom module to another - Workflow + Custom Function. Request for the example

Copying the fields from one custom module to another - Workflow + Custom Function. Request for the example

I need your help in setting up a custom function that will work as follows:

1/.  In Module 1, I will select a record from Module 2, using a lookup field

2/. Module 1 has three fields: Marka, Model, Typ

3/. In Module 2 there are three fields: MARKA, MODEL, TYP

4/. Filling in the lookup field in Module 1 should result in copying the values ​​from the fields in Module 2

 

 

I have 2 custom modules:

Custom Module 1: Przedmioty (API: Items)

Custom Module 2: Eurotax (API: Eurotax)

 

1)      Here are the fields in custom module Przedmioty:

Lookup field to custom module Eurotax: Katalog Eurotax (API: Eurotax_catalog), this lookup field is connected with the field Eurotax - nazwa (API: Name), single line

Other fields:

Marka (API: Marka), pickup list

Model (API: Model), single line

Typ (API: Typ), single line

 

2)      Here are the fields in custom module Eurotax:

Eurotax - nazwa (API: Name), single line

Other fields:

MARKA (API: MARKA), pickup list

MODEL (API: MODEL), single line

TYP (API: TYP), single line

 

Could you please help with this?

Could you please tell me how to set up a workflow and show me the code that I should use to create such a function?

Thank you very much in advance for your suport!

 

Kind regards,

Marcin