Help with a Custom Function to copy field.
I have two field in Leads Module.
Field 1: Sales Agent
Field 2: First Sales Agent
I am trying to write a function that copies Field 1 in to Field 2. (I will use the function with Workflow, as soon as Field 1 is edited to execute the function)
Here is what I have so far, but the function is showing Error:
agent = zoho.crm.getRecordById("Leads",input.agent_id);
sales_agent = agent.get("Sales Agent");
if( sales_agent != "" )
{
leads_map = new.map();
leads_map.put("Sales Agent" , "First Sales Rep");
}
Please look at attached image of the screenshot. If someone can help with this function will be great. THANK YOU!!!