Welcome back everyone!
Last week, we learnt how to turn a contact into a vendor. This week, let's look at a custom function that helps you add pre-defined notes at the click of a button.
Business scenario:
Every bit of information shared by prospects in a sales call gets you closer to making the sale. Keeping a track of these information not only helps you pick up from where you left off for subsequent calls, but also helps tailor your offering by putting the prospects in appropriate campaigns, set actionable reminders and so on. These details are then added to your CRM system either as a note or as a field update.
Depending upon the nature of your business, you might ask some standard questions in all your sales calls. How convenient would it be if you could create templates of the information to be gathered and add them as a note to a record at the click of a button.
For instance, let's assume you are a salesperson selling properties. The questions you ask your prospects might vary depending on whether the customer requires an individual home, or an apartment, or a villa. Add these questions easily as a note on the record concerned using this custom function. You can also have multiple note templates based on the prospect category. When you determine that the prospect wants an apartment, click the button which has the specified questionnaire. The pre-defined note gets added to the record, and you just have to fill in the answers based on inputs from the customer.
Getting started with the custom function:
- Go to Setup > Customization > Modules > Select the required module > Links and Buttons > +Create new button.
- Provide a name for the button. For example: “Lead Follow-up Note”. Add a description(optional).
- Choose View page from the drop-down list.
- Select Writing custom function from the subsequent drop-down.
- Provide a name for the custom function. Add a description(optional).
- Click “Free flow scripting”.
- Copy the code given below.
- Click “Edit arguments”.
- Enter the name as “ leadId” and select the value as “Lead Id”.
- Save the changes.
- Click Save to create the button.
The script:
This example code is for creating a Note record for a Lead.
Code for Version 2.0 API:
desc = "Customer house requirement: Apartment"+ "\n" + "Buy or Rent:"+ "\n" +"Budget:"+ "\n" +"Floor preferred: "+ "\n" +"Number of bedrooms preferred:"+ "\n" +"Parking requirements:";
notemap = Map();
notemap.put("Parent_Id",input.leadId);
notemap.put("Note_Content",desc);
notemap.put("se_module","Leads");
notecreate = zoho.crm.create("Notes",notemap);
info notemap;
info notecreate;
return "Notes added Successfully";
Code for Version 1.0 API:
desc = "Customer house requirement: Apartment"+ "\n" + "Buy or Rent:"+ "\n" +"Budget:"+ "\n" +"Floor preferred: "+ "\n" +"Number of bedrooms preferred:"+ "\n" +"Parking requirements:";
notemap = map();
notemap.put("entityId", input.leadId);
notemap.put("Note Content",desc);
notecreate = zoho.crm.create("Notes", notemap);
return "Notes added Successfully";
Note:
- This custom function is useful as many templates can be stored and there are no limits on the number of custom buttons you can create. Furthermore, you might want to try adding the notes record to all modules.Change the ID of the record from 'leadId' to the intended module record ID name and update the code accordingly.
- Found this useful? Try it out and let me know how it works! If you have questions, do not hesitate to ask! Share this with your team if you find it useful. Do check out other custom functions shared in this series here.
See you all next week with another interesting custom function. Ciao!