Setting up Catalyst for CRM Bulk Processing

Learn how to set up Catalyst for bulk data processing in Zoho CRM.

 

To access this Catalyst Solution in your Zoho CRM:

  • Go to Setup > Developer Hub > Catalyst Solutions > CRM Bulk Processor.
  • Click Go to Catalyst. You will then be redirected to:

    • Create a Catalyst account if you do not have one, or
    • Select the organization you want to use if you already have an account.
    • Once done, you'll be taken to the CodeLib page of the selected organization.

    Preview of the Call To Action

    Let us set up your Catalyst account to process bulk data efficiently by following these simple steps.

    Prerequisites

    Before getting started, ensure you have the following ready:

    Home Page of Catalyst

    • An active Catalyst account with access to the developer console for an organization.
    • Catalyst CLI installed on your local system. Refer to the Catalyst CLI Installation Guide for detailed steps.
    • A project folder on your local system. Run the following command on your terminal to create it.

       

      mkdir -p <folder_name>

    Pro Tip

    Use the same project folder for multiple Catalyst projects. Ensure to create a new folder for each project.

    Step 1: Initialize Your Project and Install CodeLib

    1. Navigate to your local project directory and run the following command to initialize your project:

       

      catalyst init

      Follow the prompts to select and initialize your desired project.

      To initialize/use a Catalyst project

      If you have a project that was previously initialized using the Catalyst CLI and want to reuse it, execute the following command to select and activate the existing Catalyst project:

       

      catalyst project:use

      Follow the prompts to choose your desired project. 
      Explore the guide on initializing resources to gain more insights.

    2. Run the following command to install the CRM Bulk Processing CodeLib:

       

      catalyst codelib:install https://github.com/catalystbyzoho/codelib-zoho-crm-bulk-processor

      Installing Bulk Processor CodeLib

    Step 2: Create a Cron Job

    Set up a Cron job in your Catalyst Developer Console to trigger the automation of bulk data processing.

    1. Open the Catalyst Developer Console and navigate to the same project in which you have installed the CodeLib.
    2. Go to Cloud Scale > Triggers > Cron and click Create Cron. Creating a Cron
    3. Fill in the following details:
      • Name: Provide a name and description for the Cron job.
      • Schedule Point: Select Function and choose BulkJobSchedule from the dropdown in the Target Function field.
      • Function Parameters: Enter the following two parameters with required values,
        • MODULES: API name of the Zoho CRM module that has to be processed.
        • FIELDS_TO_BE_PROCESSED: API names of the fields from the module which has to be processed.
      • Choose the desired Schedule Type. For more details, refer to the Implementing Cron Jobs Help Guide. Cron Scheduler

    Note

    Use Zoho CRM GET Modules and Fields metadata APIs to find out the API names of your desired module and fields.

    Step 3: Configure Zoho CRM API Credentials

    1. Create a self-client application in Zoho's API Console.
    2. Generate a Grant Token by copying and pasting the following scopes:

       

      ZohoFiles.files.ALL,ZohoCRM.bulk.ALL,ZohoCRM.modules.ALL,ZohoCRM.settings.ALL,ZohoCRM.org.ALL

      Generating access code for bulk processor

    3. Follow the OAuth Help Section for a step-by-step guide to generate Access and Refresh tokens for your Zoho CRM organization. 
      Save all the credentials securely for later use.

      Generating access code for bulk processor

    Step 4: Configure Function Components

    1. Open your Catalyst project folder on the terminal and navigate to the functions directory.
    2. Locate the catalyst-config.json file within functions>BulkDataProcessor and open the file using the following command.

       

      vi catalyst-config.json

    3. Enter the letter 'i' in your terminal to edit the following environment variables in the file.

      Environment VariablesValues
      CLIENT_SECRETGet the value from Zoho API Console > Self Client > Client Secret.
      CLIENT_IDGet the value from Zoho API Console > Self Client > Client Secret.
      REFRESH_TOKENThe Refresh Token generated in the previous step.
      CODELIB_SECRET_KEYAn alphanumeric value with a minimum of 32 characters.
    4. Click 'esc' and use the following input to save the changes you have made:

       

      :wq

      Setting up environment variables

    Note

    Functions in Catalyst are unauthenticated open resource. But the CODELIB_SECRET_KEY helps to secure your data in Catalyst. You must pass this key-value in the request header of the cURL command you execute, to invoke this function.

    Step 5: Add Custom Logic and Deploy

    Customize the bulk data processing logic to suit your business requirement.

    1. Open the local project folder in any code editor and go to com.processor.record.ZCRMRecordsProcessorImpl.java file of the BulkDataProcessor in the functions directory. Add your Custom Logic
    2. Override the ZCRMRecordsProcessor method with your custom logic, such as data transformation or cleansing.
    3. Catalyst CLI works only with the Development environment of your Catalyst Project. So deploy these customizations to the production environment by running the following command:

       

      catalyst deploy

      Deploy to Production

    Execution

    Your Zoho CRM Bulk Data Processor will now run automatically based on the schedule defined in your Cron job.