Setting up Catalyst for CRM Bulk Processing
Learn how to set up Catalyst for bulk data processing in Zoho CRM.
Table of Contents
Prerequisites
Step 1: Initialize Your Project and Install CodeLib
Step 2: Create a Cron Job
Step 3: Configure Zoho CRM API Credentials
Step 4: Configure Function Components
Step 5: Add Custom Logic and Deploy
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.
  - 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:  - 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- 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.  - 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.
- Run the following command to install the CRM Bulk Processing CodeLib: - catalyst codelib:install https://github.com/catalystbyzoho/codelib-zoho-crm-bulk-processor  
 - Step 2: Create a Cron Job- Set up a Cron job in your Catalyst Developer Console to trigger the automation of bulk data processing. - Open the Catalyst Developer Console and navigate to the same project in which you have installed the CodeLib.
- Go to Cloud Scale > Triggers > Cron and click Create Cron.  
- 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.  
 
 - 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- Create a self-client application in Zoho's API Console.
- 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  
- 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. 
 - Step 4: Configure Function Components- Open your Catalyst project folder on the terminal and navigate to the functions directory.
- Locate the catalyst-config.json file within functions>BulkDataProcessor and open the file using the following command. - vi catalyst-config.json 
- Enter the letter 'i' in your terminal to edit the following environment variables in the file. - Environment Variables - Values - CLIENT_SECRET - Get the value from Zoho API Console > Self Client > Client Secret. - CLIENT_ID - Get the value from Zoho API Console > Self Client > Client Secret. - REFRESH_TOKEN - The Refresh Token generated in the previous step. - CODELIB_SECRET_KEY - An alphanumeric value with a minimum of 32 characters. 
- Click 'esc' and use the following input to save the changes you have made: - :wq  
 - 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. - 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.  
- Override the ZCRMRecordsProcessor method with your custom logic, such as data transformation or cleansing.
- 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  
 - Execution- Your Zoho CRM Bulk Data Processor will now run automatically based on the schedule defined in your Cron job. 










