Skip to main content

Linker modules in Zoho CRM for many to many relationships

In Zoho CRM, it's relatively easy to set up a one to one or one to many relationship using lookup fields. E.g. Let's say you're configuring the CRM for a real estate firm and there's a one to one mapping between owners of a house (which we'll use the Contacts module for) and the property itself (which we'll set up in a custom module). Just add a lookup in the property module for Owner and hey presto, you have a one (owner) to many (properties) relationship.

But what about if it's many to many. For example, if instead of the people being the ones selling the house, we actually want to track interested buyers. We have a few options:
1. We could rename Products to Properties and use the inbuilt many to many feature in Leads which allows you to add unlimited products to a Lead. However, if you're not using the Products module, then this won't work. There's no way to set up the same functionality for custom modules or any module apart from Products.

2. We could add 50 separate fields to the property: "Buyer 1", "Buyer 2" but this is incredibly ugly and non-scalable.

3. Preferred option: use a linker module, e.g. "Expression of interest"

In our example, "Expression of interest" would have a lookup for "Potential Buyer" and "Property". As such, it would have a one (buyer/property) to many (expression of interest) relationship with the underlying modules and facilitate a many to many relationship between buyers and properties. Now you can have unlimited expressions of interest for a single property - many buyers can be interested in it and each buyer can be interested in multiple properties.

This is a flexible approach and one I've used in several client projects.

Comments

  1. Hi Jeremy,

    I'm new to Zoho and trying to get my head around implementing many-to-many relationships. Your 'option 3' sounds very promising but there's not enough detail here for me to understand what you mean. Is there any chance you could expand, perhaps a step-by-step how-to?

    thanks,
    Martin.

    ReplyDelete
    Replies
    1. Hi Martin, my video: https://www.youtube.com/watch?v=j3AhCNNcWis has more details.

      Delete

Post a Comment

Popular posts from this blog

Getting current time in a specified timezone using Deluge script

Recently I was working on a custom function for Zoho CRM which required me to get the current time in a specified timezone. I assumed that zoho.currenttime would give me the time based on the timezone chosen in the organisation settings but discovered that it always gives it to you in PST. The Zoho Partner team gave me this snippet to solve the problem: current_time_in_timezone = zoho.currenttime.toString("yyyy-MM-dd'T'HH:mm:ss", "Australia/Sydney").toTime("yyyy-MM-dd'T'HH:mm:ss"); If you need the current date, do: current_date_in_timezone = zoho.currenttime.toString("yyyy-MM-dd'T'HH:mm:ss", timezone).toDate(); To figure out what you can put in for the timezone part, refer to https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

Debugging Deluge script in Zoho Creator/Zoho CRM

Deluge is a powerful language that simplifies a ton of things, e.g. database lookups. But I have to say, it's very painful to debug. Interpreting longish scripts takes ages, error messages are obtuse if they exist at all and even the hints in the IDE don't always help (ever tried using containsIgnoreCase based on the auto-complete suggestion?). Here are my tips for debugging code when it's not working. 1. Split your code up into small custom functions. Nothing's more painful than waiting 30 seconds for a really long (say 1000 lines) HTML page to save and only then get feedback on a syntax error. I've got a few apps that are like this and it's not fun to work with at all. I haven't seen any improvements in the compile speed over the last few years, so my conclusion is that it's always best to write most of your logic code as small custom functions and then build that up in the HTML page so that you'll get quick feedback on syntax errors. 2. If

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.g