Update Fields Online in Leads with Information from the Accounts Module

Update Fields Online in Leads with Information from the Accounts Module

Hi, I would like to know if it is possible to update online the fields of a Lead with information that are in the Accounts module when I select the company A that exists in the module Accounts without saving the Lead, for now the only way I have found to do that is through the following function, but using the Lead ID and for that I need to save the Lead and what I want is to show me the information before saving it.

 

tempMap = Map();

tempMap.put("Account Name",Account_Name);

resp_accounts = zoho.crm.getRecords("Accounts",1,200,tempMap);

accounts_map = resp_accounts.toMap();

rut1 = accounts_map.get("RUT");

resp_leads = zoho.crm.getRecordById("Leads",Lead_Id);

resp_leads.put("RUT",rut1);

update_lead = zoho.crm.updateRecord("Leads",resp_leads.get("id"),resp_leads);

info "Response: " + update_lead.toString();

 

The fields that I would like to be completed automatically before saving the Lead depending on the company that you select in the Company field and that is previously created in Accounts is the following.