Custom Function to Auto Populate text fields from module to module
Hello All,
I have two modules. Opportunity and Project Status. I want to create a new project for each new client in project status but, currently we are manually typing all the data instead of pulling it in from the Opportunity module where the existing data lives.
The fields in both modules are the same :
Opportunity Name
Project Address
Project City
Project State
Project Zip Code
Here is a function i've tried to create with some help but, I keep getting errors.
On update
// Check if the Opportunity Name field has been updated
if (input.Opportunity Name != old_value.Opportunity Name)
{
// Get the details of the related Opportunity
opportunityDetails = zoho.crm.getRecordById("Opportunities", input.Opportunity_Name);
// Create a map to hold the new field values
updateMap = Map();
updateMap.put("Project_Address", opportunityDetails.get("Project_Address"));
updateMap.put("Project_City", opportunityDetails.get("Project_City"));
updateMap.put("Project_State", opportunityDetails.get("Project_State"));
updateMap.put("Project_ZipCode", opportunityDetails.get("Project_ZipCode"));
// Update the Project Status record
updateResponse = zoho.crm.updateRecord("ProjectStatus", input.id, updateMap);
}