I have to 2 modules. one being leads and one being sale sheet. When i created the sale sheet module, some of the fields are already existing in the leads module. Just trying to figure out a way that if i select which record it relates to using relate field, how can i auto populate the records with the existing data.
How can i proceed with this:
Any help will be much appreciated!
Hi John Ade,
You can use populate_list property in vardef file of a relate field to populate value from one record to another record.
For your use case, edit the Lead's relate field definition under Sale Sheet module and add the fields you want to populate from leads to sale sheet.
$dictionary['<sale_sheet_module>']['fields']['<leads_relate_field_name>']['populate_list'] = array(
'<field_in_leads_module>' => '<field_you_want_to_autopopulate_in_sale_sheet>',
'<another_field_from_leads>' => '<another_field_you_want_to_autopopulate_in_sale_sheet>',
);
Also, if you do not want to prompt user before auto populating the values, you can set the following auto_populate property to true.
$dictionary['<sale_sheet_module>']['fields']['<leads_relate_field_name>']['auto_populate'] = true;
Note: <leads_relate_field_name> is the name field of your relate field definition.
Please let us know if this helps.
Regards.
Hats