Function-12: Add pre-defined notes to records in a click

Function-12: Add pre-defined notes to records in a click



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!

Update: As you must be aware, API V1.0 will be deprecated and support for version 1.0 API will be available only till Dec 31, 2018. Version 1.0 compatible Functions will continue to work until Dec 31, 2019. You're advised to migrated to API Version 2.0 at the earliest. Check this announcement for more. We've updated the post to include the Version 2.0 compatible Function.

      • Sticky Posts

      • Function #41: Sync Associated Subforms!

        Welcome back everyone! The last custom function showed how to update a Contact with Product details from it's Related list in Deals. This week, let's look at a function that lets you update subform records in two modules simultaneously when one of them is updated. Business scenario Let's look at how subform helps in an education institution that has deployed Zoho CRM. National Public School, Austin (made up, of course!) has set up Zoho CRM and it follows the same relationship pattern of "Students",