Skip to main content

Posts

Showing posts from 2015

Round robin lead assignment for API generated leads in Zoho CRM

Do you add leads to your CRM via the Zoho CRM API? If so, you'll note that lead assignment rules don't work. I have developed a CRM extension called Advanced Round Robin that you can buy on the Zoho Marketplace. If you'd prefer to do it yourself, the below code can allow you to add round robin lead assignment functionality (though it's missing many of the more powerful features of the Advanced Round Robin extension). You'll need to set a few config variables like your authtoken and the user role you want leads to be assigned to. You'll also need to create a reference lead that's assigned to one of the users who should receive leads. The script will use this to figure out who should get the next lead. Thanks to Prakash from Zoho for giving me the base code for this script.


Want more options? I have a paid version of this script that you can buy on the Zoho Marketplace.

How to learn to write custom functions in Zoho CRM

Thomas posted a really interesting question on the Zoho CRM forums. He wants to know the best way to learn to write custom functions in Zoho CRM.

I recorded a video reply:


If you don't feel like watching the video, here's a summary of my tips:

1. Check out the Deluge Script eLearning course - Deluge is the language you'll use to write custom functions.

2. If you don't have a programming background, start off by learning Javascript at CodeAcademy as JS is pretty similar to Deluge and has a lot more learning resources.

3. Have a read through some of the articles on my blog, e.g.
 - how to quickly add call logs
 - forecasting subscription revenue in Zoho CRM
 - add related notes to a contact

4. Email me with any questions (jeremy.nagel [at] nuanced.it) - I'm always happy to help people learn Deluge

Making Zoho CRM webforms responsive

I've had quite a few people ask me for help making Zoho CRM webforms responsive. My standard answer is "don't even try". The forms look bad anyway and are hard to work with. A better option is to use Ninja Forms (a wordpress plugin that makes nice looking forms that integrate with Zoho CRM).

If you do want to persist with using Zoho CRM's webforms, this video explains an approach to making them responsive. I've built a little utility that does some of the work for you. You'll still need design skills to make the forms look nice afterwards but it might save you some time.

Here's the video showing it in action:

Importing invoices into Zoho CRM

There's a bit of a trick to importing invoices into Zoho CRM. You have to use the API to achieve it. Most of the fields are pretty standard but when you're adding the product details, you have to do it like this:
Product_Details_List=List();subTotal=input.Renewal_Amount;productDiscount=0.0;productTotal=input.Renewal_Amount;product_map=map();product_map.put("Product Id",input.Zoho_CRM_Product_ID);product_map.put("Quantity",1);product_map.put("Unit Price",input.Renewal_Amount);product_map.put("List Price",input.Renewal_Amount);product_map.put(("Discount"),0);

Forecasting subscription revenue in Zoho CRM

Zoho CRM is only set up to handle once off deals out of the box. What should you do if you want to be able to forecast subscription revenue months/years into the future? If your customers renew every month, wouldn't it be nice to know how much you're likely to make in quarter three so you can see whether your pipeline is short or not?

Here's a Deluge custom function that you can hook up with a workflow to automatically generate potentials for future months. It won't duplicate existing potentials so you can set it up to run once per month and make sure you always have the next 2 years worth of revenue forecast.

Ideally you'd also have a function to change the status of future potentials when the master potential is modified. (E.g. if a customer cancels their subscription, the future potentials should also be nullified). Let me know if you'd like that function and I can build it for you:)

Overcoming Application Fatigue

How many apps do you have on your phone right now? I have 178. Of these, I have used 45 in the last month - that's 25.2% of the total. What's happening here? Clearly I thought these apps had some merit or I wouldn't have installed them in the first place. But at some point (or several points), I reached app overwhelm and abandoned all but the tried and tested ones. Not another app!
To give you an example, I must have tried out over 20 project management systems. I started with Evernote, graduated to Zoho Projects when I had to involve other people, then moved to Podio, then moved to JIRA, then started using Trello as well plus a bunch of Google Spreadsheets. Eventually it all became too much and I returned to the killer app: paper..



As a software developer, I feel like a bit of a traitor to the cause. If I can't handle lots of apps, then how can anyone else? I occasionally come across lists of '99 MUST USE APPS!!!' and feel almost nauseous. I'm barely copin…

Add related Notes to a Zoho CRM Contact from custom script

This post is a response to a question on the Zoho CRM forums:
Hi

Is it possible to relate additional notes to a Contact from a custom deluge script ? 
I guess it could be done by calling the external API postUrl() but I'm wondering if it can be done directly by something like zoho.crm.create()
Thanks  It is indeed possible. Here's a code snippet:


And the outcome:

Zoho CRM Custom Commands for a list view

This post is in response to a question on the forums:
"Hi,Using Zoho CRM, I need to provide my users with some custom commands on the Contacts view list. These commands would invoke a custom deluge script."
I've faced this issue in the past. My solution is as follows:

1. Create a checkbox field for the Contacts module called "Run custom function"

2. Create a workflow that checks for field updates to the "Run custom function" field

3. Trigger a custom function from that workflow that does whatever you want and also resets the checkbox to false so that the user can trigger it again. For an example of a custom function, check out my post on quickly generating call logs.

In this way, a user can mass update the checkbox to run custom functions on all of the records.

searchRecords with multiple criteria in Zoho CRM API

NB: this blog post is no longer relevant as API v2 lets you use searchRecords with multiple criteria :)

I discovered something really cool tucked away in the Zoho CRM forums today. For the history, check out this thread. In summary, the searchRecords API task in Zoho CRM is impossible to use if you have multiple criteria and in general it's pretty annoying to get the single criterion right. In the forum thread, Zoho Support advised that you can actually use getRecords with a view name. This feature is not documented on the getRecords page at all but I can confirm it works:D

This is really, really cool. It's going to make my life as a Zoho dev much easier! Instead of having to do something really inefficient and ugly like:
leadRecords = zoho.crm.searchRecords("Leads","(Created Time|<|" + yesterday_date +")",fromIndex,toIndex);for each ele in leadRecords{lead_source = ele.get("Lead Source");createTime=(ele.get("Created Time")).…

Cohort analysis of CRM data using Zoho Reports

Cohort analyses are super handy if you're running a subscription business and want to see changes in ARR/MRR (annual/monthly recurring revenue). I've been thinking about how to achieve this for Zoho CRM data. A tip from Zoho Reports about using the color option in a chart gave me the answer.


To get this chart, I created a query table that combines the Invoice and Account modules and uses the quarter/year functions to group cohorts. The query is:
SELECT (year("Accounts"."Created Time") + '-' + quarter("Accounts"."Created Time")) as "Quarter joined", "Accounts"."Account Name", "Invoices".*FROM  "Accounts" JOIN "Invoices" ON "Accounts"."ACCOUNTID"  = "Invoices"."Account Id" 

Tracking real sales conversion rates for cold leads using Zoho Reports + Zoho CRM

The Zoho Reports team helped me out with a tricky report to show the lead to won potential conversion rate. To explain the report, let's consider this scenario:
1. The business had 1000 leads entered into the CRM through telemarketing
2. Salespeople then qualified those leads and converted 50 of them to opportunities
3. The sales team then closed 10 of those leads

Based on those stats, we'd expect the lead to won potential win rate to be 1% (10/1000). In the default Zoho Reports conversion stats, you can only see potential to closed potential conversion rates. This stat is misleadingly high (10/50 = 20%) because it's only considering converted leads and ignoring junk/lost leads.

If the sales team really closed 20% of cold leads, you would probably see them usurping Brian Tracy on the speaking circuit. In reality, they're decent (1% conversion) but not world beating. I don't know about you, but I prefer to deal with reality.

How to generate true conversion rate stat…

How to quickly add call logs to Zoho CRM leads using workflows

Want a faster way to add call logs? Check out this video that shows you how to add call logs by ticking a box. (Warning: Enterprise Edition + deluge scripting skills needed).



Calculating amount of Zoho CRM potential based on associated products

If you link products to your potentials in Zoho CRM, you can dynamically calculate the total amount of a potential by using a custom function + a workflow.


Here's the code:

Performing mass updates on thousands of Zoho CRM records using custom functions

Need to mass update thousands of Lead records in Zoho CRM and can't be bothered manually clicking through tens of pages and doing mass update? Here's an example of using a custom function to achieve this. In this case, I needed to merge several notes fields into one text area field as the multiple note fields were becoming unwieldy.

How to copy and paste form fields in Zoho Creator using Form Definition

I had to replicate a bunch of fields in a Zoho Creator form (i.e. I'd created them for client 1 and then needed to recreate them for client 2). I figured it would be faster to go into the form definition and copy and paste elements there rather than creating them via the UI. It ended up taking longer haha. For some reason the form definition seems to be very temperamental. I can't precisely tell you what ended up allowing it to work, but here are some things that you definitely can't do:

1. Have a field with the same ID as another field (display name can be duplicate though)

2. Have any comments in the form definition.

I was plagued with "Error: null" (gotta love ZC's highly descriptive error messages!)

Work around for annoying auto-indentation in Zoho Creator free flow scripting mode

If you're like me, you probably hate the auto-indentation feature in Zoho Creator. It always puts braces in the wrong positions and indents at the wrong level. I got sick of having to backspace 20 times to get indentation looking good so looked for another solution.

I found it in http://jsbeautifier.org/

You can chuck your Deluge script in there and it will indent it nicely for you:)

Firefox webdriver not working properly? Try downgrading Firefox

I spent several hours trying to get my Selenium script working properly. FirefoxDriver flat out refused to work, ChromeDriver wasn't taking screenshots, complaining about not having the automation extension installed, and PhantomJS wasn't suitable because I needed to take screenshots of Flash-generated reports (*groan*). Eventually I realised that Firefox had auto-updated to v38 and broken Selenium as a result. I uninstalled v38, reinstalled v34 (and disabled auto updates) and it now works like a charm:) Hope this saves you some pain!

Changing lead privacy settings in Zoho CRM

Deserialization in Ember Data (CLI edition May 2015)

I was working on a side project to learn Ember JS recently and hit a major roadblock with deserializing data from a REST API. I have a model that looks like this:


Ember therefore expects a JSON payload that looks like this:
However, the API (from Kimono) actually returns a payload with the people array embedded within a results array:
I spent hours trying to figure out how to use the deserialize methods to extract the people array from the results array. What frustrated me was that I couldn't really find any examples of how to use the deserialize methods. Maybe it's super basic for most people but I'm an Ember noob and couldn't figure it out for ages.
To help you avoid my teeth gnashing, here's the code I wrote for my serializer.
To explain what's going on here, we have to override a few methods: extractSingle (if there's only one person returned), extractArray (if you used findAll) and normalizeHash (used by both of the two previous methods).
extractS…

How to mass update lookups in Zoho CRM

You'll notice that you can't mass update lookup fields in Zoho CRM via the UI. Here's a code snippet to show how to update lookup fields using Deluge custom functions.


You then have to set up a workflow to run that custom function on a certain trigger. Feel free to ping me if you can't figure it out.

Accessing query params from a route in Ember CLI in May 2015

I just spent 90 minutes trying to figure this out so hopefully this will help other people avoid similar pain! If you want to access query params from a route in Ember it's actually really simple: just declare the query params in the controller first.

E.g.
export default Ember.Controller.extend({
queryParams: ['city', 'company'],
And then in the route:
model: function(params) {var city = params.city;var company =  params.company;

Trick to calling other custom functions from within Zoho CRM custom function

One thing that has bugged me about Zoho CRM custom functions is that they can quickly become very bloated because the programming interface steers you towards putting all the code in one method. I realised today that there is a way around that though. If you add the namespace 'workflowspace' before the custom function name, you can call it from another custom function.

E.g. workflowspace.round_robin_engagements(engagement_id.toLong());

Using PhantomJS with PHPUnit

I found it pretty hard to get PHPUnit working with PhantomJS so thought I'd put together a quick tutorial.

Step 1: Make sure you have the following dependencies in your composer.json and run composer update:
"require-dev": {        "facebook/webdriver": "dev-master",          "phpunit/phpunit": "4.0.*",         "phpunit/phpunit-selenium": ">=1.2"  }Step 2: Download PhantomJS and Selenium Server and put them in a new directory 'bin' in your tests folder. (Might not be the most optimum place to stash them but it works for now)

Step 3: Add the following code to your tests folder as TestScaffold.php. It will start the Selenium server if it's not already running and boot up PhantomJS for each test.
Step 4: Write a test that extends the scaffold

Configuring webform URLs for Zoho CRM

Are you finding that your Zoho CRM web forms don't do anything? I've learned the hard way that it's generally because the form URL has not been set correctly. It seems like a throw-away setting, but it actually won't work unless you configure the form URL to be exactly where the form is on your website. Use this link to access the web form page, then click on the form name and finally click on "Next Step" to show this dialog.


Keeping your OnInput code DRY in Zoho Creator

DRY (don't repeat yourself) is one of the most important software development patterns to follow. If you copy and paste code, then if there's a bug, you'll have to go back and edit several code blocks which is likely to lead to even more bugs.

With Zoho Creator OnInput scripts, it can be challenging to apply DRY because you can't really use functions within an OnInput script. You can call a function at an app level, but this function won't be able to access any of the current form fields.

Here's an example I encountered recently when reviewing code from one of my devs.

As you'll read from the comments, this code isn't DRY. The same exact code block was used for several other OnInput functions. (The goal of this block is to update a subtotal field at the bottom of the form when the quantity or price is changed).
As mentioned, you can't use a custom function to achieve this, but you can put the code in one place. I typically create a new decision box …

Configuring page breaks in Zoho Creator

I've had a helluva time trying to get page breaks to behave properly in Zoho Creator HTML pages when you export them as a PDF. Here's an example:
After trying absolutely everything, I finally realised that it just is not possible to properly configure page breaks in PDF mode.

However, there is a work-around. Use print mode and then use a print-to-pdf driver to save the output as a PDF.

Then all you have to do is add this CSS to the top of your page:

<style type="text/css">    table { page-break-inside:auto }    tr    { page-break-inside:avoid; page-break-after:auto }    @media all { .page-break  { display: none; }    }    @media print { .page-break  { display: block; page-break-before: always; }    }
</style> This will prevent page breaks from occurring within tables. If you want to force a page break, you just have to add <div class="page-break"></div>.

How to email accounts from Zoho CRM

Bashing your head against a wall trying to figure out how to email your accounts from within Zoho CRM? This screencast explains how. If you need any further help with this or with anything related to Zoho CRM, give me a shout at jeremy.nagel@nuanced.it or call me on 0414 885 787 I run a Zoho CRM consultancy (www.nuanced.it) with offices in Sydney and Melbourne.

Auto populating custom field in Zoho CRM using criteria

I saw this question in the Zoho forums and thought I'd respond:
Is there way to auto-populate a field given a set of criteria?
For example, I'd like all Potentials that close between a set of dates (i.e. between 1/1/2015 and 5/1/2015) to automatically populate the same text in a custom field I've called "Group."
My Answer

voidmodify_group_for_jim_based_on_closing_date (intpotential_id)potential = zoho.crm.getRecordById("Potentials",input.potential_id);the_closing_date=(potential.get("Closing Date")).toDate();date_window_1=("1/1/2015").toDate();date_window_2=("1/5/2015").toDate();date_window_3=("1/6/2015").toDate();date_window_4=("1/11/2015").toDate();potential_map=map();if((the_closing_date  >=  date_window_1)  &&  (the_closing_date  <=  date_window_2)){potential_map.put("Group","Group 1");}else if((the_closing_date  >=  date_window_3)  &&  (the_closing_date  &…

Selecting multiple products and associating them with a Zoho CRM lead

I saw a question in the Zoho CRM forums that I thought I'd answer:
I created a custom field in the Lead form for Product and it is linked to our Product list in Zoho so when we click on the field to fill it in for a lead, it pulls up our Product list. However, once I click on one product, it automatically populates the field with that product without allowing me to select additional products. (Our leads and customers are often interested in multiple products.) Is there a way to keep the field linked to our Zoho Product list and make it multi-pick? My answer
I'd recommend using the Products related list for this purpose. Here's a screencast showing you how. You can report on which products are associated to which leads by choosing both modules when creating a report.


How do you use Price Books in Zoho CRM?

What is a price book and why would you use one? In this video, I walk you through the process of setting up price books so you can have volume discounts for your best clients.



Got more questions? Leave a comment or ping me at jeremy.nagel@nuanced.it