Building a Real Estate CRM

Zoho Developer Console allows developers to transform your CRM into an industry specific CRM solution. A real estate CRM needs to manage comprehensive and comparative details about properties, offer ease in handling Buyer and Client data and provide the convenience of effortlessly pulling out information corelated to one or more module(s). Integration with other real estate specific third party application(s) further enhances the usability of a real estate CRM. Property Pro is a real estate CRM which embodies all these features and much more, thereby giving customers the competitive market advantage.

 Setup a CRM application

The first step in building your vertical CRM is to configure certain basic settings and choose the application modules you'd like to include.

To create and setup a new application

  1. Log in to your Zoho Developer account and click CRM for Verticals.
  2. In the Vertical CRM page, click Create App.
  3. In the New CRM for Verticals page, input the name of your application, appropriate to the industry, for e.g. "Property Pro" and your URL as "propertypro.zohoplatform.com".
    Note: Your URL can be mapped to your custom domain later when you are branding your application.
  4. Select Realestate from the Select Category dropdown.
    The category denotes the industry (Automobile, Insurance, Health care, etc.) for which your application is being developed
  5. The modules Leads, Contacts, Potentials, Documents, Reports, Activities, Forecasts and Social alone should be selected. Uncheck the rest of the modules.
  6. Provide a Short Description about your application.
  7. Click Create. A new application is created.
         

 Configure the Organization Variables

  1. Select your application and click Company Settings in the left pane and click Org Settings.
  2. Click Create and set up the custom variables:
         

 Rename the preset modules

The preset modules can be renamed to suit the real estate lingo and they can be mapped as explained below:

  1. Click Modules in the left pane.
  2. Hover over the module which you want to rename and click 'Rename' as shown below: 
       
  3. Provide the module name in Enter Module Name dialog box, 
  4. Some of the preset modules have been renamed as mentioned in the below table. 
    Sl.NoDisplayed in tabs asModule Name
    1Buyers Leads
    2Clients Contacts
    3Transactions Deals
    4Activities Activities
    5Tasks Tasks
    6Events Events
    7Calls Calls
    8Dashboards Dashboards
    9Reports Reports
    10Documents Documents
    11Social Social
    12Forecasts Forecasts

 Create a Custom Module

  1. Click Modules in the left pane.
  2. In the Modules page, click Create New Module.
  3. To enter the module name details, click on the edit symbol [].
  4. Enter the singular and plural form of the module name in the Module Details dialog box as "Property" and "Properties" respectively.
  5. Click Save Layout.
  6. Select the profile "Administrator". Users in the selected profile(s) will have access to the custom module.
       
  7. Click Save Layout.

 Add new fields to the new custom module

  1. Click Modules in the left pane.
  2. In the List of Modules page, click Properties module.
  3. In order to add fields into sections, drag and drop the New Section into the layout and rename it. Subsequently, add the fields listed below:
     

    List of sections and Custom fields

    Sl.NoFieldData Type
    Property Information (section)
    1Approved Checkbox
    2Year Built Single Line
    3Unapproved Checkbox
    4Year Updated Single Line
    5Parking Type Single Line
    6No of Bedrooms Single Line
    7Rooms Single Line
    8No of Bathrooms Single Line
    9Type of Property Pick List
    10Built up Area Single Line
    11Property Component Multiselect
    12Property Area Single Line
    13No of Floors Single Line
    14Basement Single Line
    15Heating Sources Single Line
    16View Single Line
    17No of Owners Pick List
    18Buyer Lookup
    19Transaction Lookup
    Pricing Information
    20CMDA Approval Single Line
    21Maintenance Cost Single Line
    22Property Approx Price Single Line
    23Zestimate Single Line
    Address Information
    24Street Single Line
    25City Single Line
    26State Single Line
    27Zip Code Single Line
    28Country Single Line
    Neighbour Information
    29Neighbourhood Pick List
    30Elementary School Lookup
    31Middle School Lookup
    32District School Single Line
    Unused Section (preset fields)
    33Property Owner Single Line
    34Created By Single Line
    35Modified By Single Line

 Add a Custom Function

Fetch Properties Rule - Custom Function

Whenever a new buyer is added into the CRM system, details about properties in the buyer's preference location are fetched and displayed in the 'Properties' module.

To create the Fetch Properties custom function, perform the following:

  1. Click Automate in the left pane.
  2. Select Workflow
  3. Under Rules tab, click Create Rule.
  4. Provide the following details:
    1. Basic Information
      • Module: Buyers
      • Rule Name: Fetch Properties
      • Provide a Description
    2. Rule Trigger
      • Execute based on: Select A Record Action.
      • Select Create.
      • Click Next.
    3. Rule Criteria
      • Select All Records.
      • Click Next.
    4. Under Actions, click [] in Call Custom Functions.
      • The Deluge Scripting Editor gets opened. 
      • Function Name: CreateProperties
      • Copy the below code into the editor:

        LeadId= input.buyer.get("Leads.ID");

        datamap = map();

        datamap.put("module","Leads");

        datamap.put("id",LeadId);

        resp = zoho.crm.invokeConnector(("crm.get"), datamap);

        respMap =(resp.get("response")).toMap();

        users = respMap.get("data");

        temp = users.subString(1,(users.length()-1));

        usersVal = temp.toMap();

        street = usersVal.get("Street");

        city = usersVal.get("City");

        state = usersVal.get("State");

        street1 = street.replaceAll(" ",("+"),false);

        street2 = city +"%2C+"+ state;

        zwsId = zoho.crm.getOrgVariable("Zillow ZWSID");

        detail = getUrl("http://www.zillow.com/webservice/GetSearchResults.htm?zws-id="+ zwsId +"&address="+ street1 +"&citystatezip="+ street2);

        zpid = detail.executeXPath("/SearchResults:searchresults/response/results/result/zpid/text()");ZillowPropertyId= zpid.toLong();

        newDetail = getUrl("http://www.zillow.com/webservice/GetComps.htm?zws-id="+ zwsId +"&zpid="+ZillowPropertyId+"&count=5");

        newzpidsList = newDetail.executeXPath("/Comps:comps/response/properties/comparables/comp/zpid/text()").toList("-|-");

        for each newzpids in newzpidsList

        {

        detail = getUrl("http://www.zillow.com/webservice/GetUpdatedPropertyDetails.htm?zws-id=" + zwsId + "&zpid=" + newzpids);

        zpid1 = detail.executeXPath("/UpdatedPropertyDetails:updatedPropertyDetails/response/editedFacts/useCode/text()");

        zpid2 = detail.executeXPath("/UpdatedPropertyDetails:updatedPropertyDetails/response/editedFacts/bedrooms/text()");

        zpid3 = detail.executeXPath("/UpdatedPropertyDetails:updatedPropertyDetails/response/editedFacts/bathrooms/text()");

        zpid4 = detail.executeXPath("/UpdatedPropertyDetails:updatedPropertyDetails/response/editedFacts/finishedSqFt/text()");

        zpid5 = detail.executeXPath("/UpdatedPropertyDetails:updatedPropertyDetails/response/editedFacts/lotSizeSqFt/text()");

        zpid6 = detail.executeXPath("/UpdatedPropertyDetails:updatedPropertyDetails/response/editedFacts/yearBuilt/text()");

        zpid7 = detail.executeXPath("/UpdatedPropertyDetails:updatedPropertyDetails/response/editedFacts/yearUpdated/text()");

        zpid8 = detail.executeXPath("/UpdatedPropertyDetails:updatedPropertyDetails/response/editedFacts/numFloors/text()");

        zpid9 = detail.executeXPath("/UpdatedPropertyDetails:updatedPropertyDetails/response/editedFacts/basement/text()");

        zpid10 = detail.executeXPath("/UpdatedPropertyDetails:updatedPropertyDetails/response/editedFacts/roof/text()");

        zpid11 = detail.executeXPath("/UpdatedPropertyDetails:updatedPropertyDetails/response/editedFacts/view/text()");

        zpid12 = detail.executeXPath("/UpdatedPropertyDetails:updatedPropertyDetails/response/editedFacts/parkingType/text()");

        zpid13 = detail.executeXPath("/UpdatedPropertyDetails:updatedPropertyDetails/response/editedFacts/heatingSources/text()");

        zpid14 = detail.executeXPath("/UpdatedPropertyDetails:updatedPropertyDetails/response/editedFacts/heatingSystem/text()");

        zpid15 = detail.executeXPath("/UpdatedPropertyDetails:updatedPropertyDetails/response/editedFacts/rooms/text()");

        zpid16 = detail.executeXPath("/UpdatedPropertyDetails:updatedPropertyDetails/response/neighborhood/text()");

        zpid17 = detail.executeXPath("/UpdatedPropertyDetails:updatedPropertyDetails/response/schoolDistrict/text()");

        zpid18 = detail.executeXPath("/UpdatedPropertyDetails:updatedPropertyDetails/response/elementarySchool/text()");

        zpid19 = detail.executeXPath("/UpdatedPropertyDetails:updatedPropertyDetails/response/middleSchool/text()");

        zpid20 = detail.executeXPath("/UpdatedPropertyDetails:updatedPropertyDetails/response/address/street/text()");

        zpid21 = detail.executeXPath("/UpdatedPropertyDetails:updatedPropertyDetails/response/address/zipcode/text()");

        zpid22 = detail.executeXPath("/UpdatedPropertyDetails:updatedPropertyDetails/response/address/city/text()");

        zpid23 = detail.executeXPath("/UpdatedPropertyDetails:updatedPropertyDetails/response/address/state/text()");

        createMap = map();

        createMap.put("Basement", zpid9);

        createMap.put("No_of_Bathrooms", zpid3);

        createMap.put("No_of_Bedrooms", zpid2);

        createMap.put("City", zpid22);

        createMap.put("CustomModule1_Name", "Zillow Property Id " + newzpids);

        createMap.put("District_School", zpid17);

        createMap.put("Elementary_School", zpid18);

        createMap.put("Built_up_Area", zpid4);

        createMap.put("Heating_Sources", zpid13);

        createMap.put("Heating_System", zpid14);

        createMap.put("Property_Area", zpid5);

        createMap.put("Middle_School", zpid19);

        createMap.put("Neighbourhood", zpid16);

        createMap.put("No_of_Floors", zpid8);

        createMap.put("Parking_Type", zpid12);

        createMap.put("No_of_Floors", zpid10);

        createMap.put("Rooms", zpid15);

        createMap.put("State", zpid23);

        createMap.put("Street", zpid20);

        createMap.put("View", zpid11);

        createMap.put("Year_Built", zpid6);

        createMap.put("Year_Updated", zpid7);

        createMap.put("Zip_Code", zpid21);

        createMap.put("Buyer", LeadId);

        l = List();

        l.add(createMap);

        dataMapzz = map();

        dataMapzz.put("module", "Properties");

        dataMapzz.put("data", l);

        response = zoho.crm.invokeConnector("crm.create", dataMapzz);

        info response;

        }

      • Click Save & Associate.
    5. To save the workflow rule, click Save.

To ensure correctness of custom function, perform the following:

  1. Click Automate in the left pane.
  2. Select Workflow.
  3. Click Custom Functions.
  4. Hover over the name of the function 'CreateProperties' and click the edit icon [].
  5. In the Deluge Scripting Editor, click Execute
  6. Provide the Buyer ID of a record and click Submit.
  7. The following API response is obtained:
              

 Create a Connected App with Related List widget

  1. Click Connected Apps in the left pane.
  2. Click the New Connected App button
  3. Provide the following details:
    • Connected App Name: Property Pro
    • Provide Description.
    • Choose Hosting: External Hosting
    • Specify Base URL: SandBox : "http://localhost:8000/"
    • Click Save

To build a Related List widget, the following groundwork needs to be done:

  1. Download the Zillow Source Code to your desktop and extract the folder.
  2. Go to https://github.com/ZohoDevelopers/embeddedApp-js-sdk/releases/.
  3. Download the latest  ZohoEmbededAppSDK.min.js and save in the "lib" folder of your source code directory.
  4. Any file hosting server can be used to host the application.

    Note: An example of how the application can be hosted using Python server is given below:

    • Go to the website https://www.python.org/download/releases/2.7.6/
    • Choose Windows x86 MSI Installer (2.7.6) (sig) to download.
    • Once Python is installed, run the server using the following steps:

    For Windows:

    1. Open Command Prompt and go to the location where you had downloaded and kept the unzipped source code for the embedded app.
    2. Start the Python server in HTTP mode with the following command
      • C:Python27/python.exe -m SimpleHTTPServer 8000

    For Mac:

    1. The python module already exists in the mac OS. So you need not download it again. Go to the location where you have saved the source code for the embedded app.
    2. Open up the Terminal and start Python by executing the following command
      • python -m SimpleHTTPServer 8000
    3. Execute http://localhost:8000 on the browser tab to verify the host from local machine.

       You can now view the list of files in the source folder.

To add the Related List widget

  1. Click Components in the left pane.
  2. Go to Related List tab in the Components page
  3. Click Add Widgets under Custom tab.
  4. In the Create Custom Widget page provide the following details:
    • Name: Property Details
    • Module: Select Properties
    • Resource Path: zillow/html/relatedListSearch.html
    • Click Save.
  5. Provide all Permissions to the connected app by following the below steps:
    • Click Connected Apps in the left pane.
    • Click the Connected App 'Property Pro'
    • Click the Permissions button.
    • In the Permissions dialog window, provide all data access permissions.

 Test the Related List widget in Sandbox

  1. Click Test your Application located at the top right corner of your application.
  2. Click Properties module.
  3. Select a Property record.
  4. In the left pane, under Related List, click Property Details. You will be able to see the following details: