The importance of each phase in the sales process cannot be stated enough. One of the most crucial stages in the sales process is the deal stage. Each deal is identified by the name of the deal. Standardizing naming conventions is a best practice that many companies follow. In the context of deal names, some examples are as follows:
- An insurance company follows a naming convention where the deal name is prefixed by the term 'Insurance for (name of the client)'.
- Consider a travel agency. They name their deals as "Trips for customers XYZ ".
- If it is a design company, the deal name goes 'Design for (name of the client)'
- If it is for a real estate company, their naming conventions would be something like 'Property for (name of the client)'.
- Naming convention of an education institute would go like 'Course for (name of the client)'.
The example below is a standard example. The specific literals can be modified based on the domain they belong to.
Business Scenario :
An organization called Zylker Inc wants to standardize the naming convention for the Deals module. Currently in Zoho CRM when you created a deal upon lead conversion, the deal name is auto populated with the Account Name/Contact Name. Instead of this, Zylker wishes the deal names to be prefixed by the term "Deal for (contact/account").
When there are only a limited number of deals, manually maintaining the standard deal name is simple. In a business with a great volume of records, manually entering the standard deal name is challenging.
In such scenarios, we can take advantage of the custom functions. We may construct a custom function that generates a deal name automatically depending on specific fields in the modules. This piece of code is used when we create a deal in the process of converting leads.
Pre-requisites :
- Make sure the specified fields needed for the creation of a deal name are present in the module.
- Choose 'Create a Deal for this Account' while converting a lead into contact.
To create a custom function :
- Go to Setup > Actions > Functions > Configure Function > Write your own.
- Provide a Function name, Display name and select the module as deal.
- Click on edit arguments, and map the required arguments. In our case, Deal ID and Account name are needed.
- Type the below given script and save.
Code :
map = Map();
//Change the concatenation based on the naming conventions
map.put("Deal_Name",'Deal for' + ' ' + acc_name);
//For example 1, Insurance company
map.put("Deal_Name",'Insurance for' + ' ' + acc_name);
//For example 2, Travel agency
map.put("Deal_Name",Trip' + ' ' + acc_name);
//For example 3, Designing company
map.put("Deal_Name",'Design for' + ' ' + acc_name);
//For example 4, Real estate company
map.put("Deal_Name",'Property for' + ' ' + acc_name);
//For example 5, Educational institute
map.put("Deal_Name",'Course for' + ' ' + acc_name);
//This is same for all scenarios
dealnameupdate = zoho.crm.updateRecord("Deals",deal_id.tolong(),map);
info map;
info dealnameupdate;
Adding the custom function to workflow :
The above code is added into the workflow rules so that the custom function is applied to all the deals created. Every custom function that we create is integrated with workflow rules or any other buttons and links.
Steps :
- Go to Set Up > Automation > Workflow rules > +Create Rule.
- Enter the required details and select the desired module.
- Select "On a record action" in the "When do you want to execute this rule?".
- Select "Create".
- Select the Condition as "All Deals".
- Choose "Function" from Instant Actions.
- Choose the desired function created by the user and click 'Associate'. In this the case the function name 'Deal name'.
- Click Save.
Execution :
This screenshot shows the deal name that are manually entered.
This screen shot shows the deal name created after the workflow rule is triggered.