In Zoho CRM, it is possible for you to copy a field's value to another field; given if the data type is compatible. What do we mean by this? For example, if you're looking to copy from a text field to a date field, this is not possible as the data type is not compatible. Some modifications can be done using Deluge to convert the data type so that it can be copied into another field. We will look at this in another article.
It is also possible to copy a field value from a module and paste it into another module. This opens up a lot of things that you can do in your business process.
Note: You have to have permission by the admin and your Zoho CRM must be on Professional edition or higher to do this
To create the functions, navigate to Setup > Automation > Actions > Functions > Configure Function > Write your own. You can also create a custom function when you're creating a workflow. Once you've clicked "Write your own", fill in the function name, display name, description (if any) and choose the module you want to copy from.
Note: the Function Name cannot contain space. Use underscore instead.
In this example, let's take the Leads module > Map Argument "leadId" to "Leads - Lead Id" by clicking "Edit Arguments" > Click Save
Then, write the code below:
- //get lead info
- leadInfo = zoho.crm.getRecordById("Leads", leadId);
- //get phone number
- leadPhone = ifnull(leadInfo.get("Phone"),"");
- //update Mobile field
- mp = Map();
- mp.put("Mobile", leadPhone);
- resp = zoho.crm.updateRecord("Leads", leadId, mp);
- info resp;
Yes, a non-beginner would say that this can be achieved with fewer lines, but if you're a beginner, this structure can help you understand how Deluge works better. You can slowly improve your skill as you go on.
Cheers