Welcome to another Kaizen week!
In our ongoing effort to enhance your Zoho CRM integration skills, we have been exploring various field types and demonstrating how to manage them using our different SDKs. So far, we have covered the Java, PHP, and Python SDKs in detail. Today, in Part IV, we will discuss field management using our remaining SDK offerings: NodeJS, Ruby, Scala, TypeScript, C#, and JavaScript.
Here is a glimpse of how to manage the field data using these SDKs.
Standard Fields:
a. Import the Field Class:
- import * as ZOHOCRMSDK from "@zohocrm/nodejs-sdk-6.0";
- let record = new ZOHOCRMSDK.Record.Record();
b. Assign Values to Standard Fields:
The syntax for assigning values to standard fields uses the addFieldValue method of the Record object:
- await record.addFieldValue(Field.{module_api_name}.{FIELD_API_NAME},value);
Replace {module_api_name} and {FIELD_API_NAME} with the appropriate values for your specific use case. Please note that the FIELD_API_NAME should always be uppercase.
For instance, to assign value to a text field, use:
await record.addFieldValue(ZOHOCRMSDK.Record.Field.Leads.LAST_NAME, "Last Name");
To assign a null value to the same field, use:
await record.addFieldValue(ZOHOCRMSDK.Record.Field.Leads.LAST_NAME, null);
Custom Fields:
To manage custom fields using NodeJS SDK:
a. Import the Record Class:
- import * as ZOHOCRMSDK from "@zohocrm/nodejs-sdk-6.0";
- let record = new ZOHOCRMSDK.Record.Record();
b. Assign Values to Custom Fields:
The syntax for assigning values to standard fields uses the addKeyValue method of the Record object:
- record.addKeyValue("{field_api_name}", value);
Replace {field_api_name} with the appropriate values for your specific use case.
For instance, to assign value to a custom text field, use:
record.addKeyValue("Single_Line_Field", "Text Single Line Value");
To assign a null value to the same field, use:
record.addKeyValue("Single_Line_Field", null);
Standard Fields:
a. Import the Field Class:
- using Com.Zoho.Crm.API.Record.Field;
b. Assign Values to Standard Fields:
The syntax for assigning values to standard fields uses the AddFieldValue method of the Record object:
- record.AddFieldValue(Com.Zoho.Crm.API.Record.{module_api_name}.{FIELD_API_NAME}, value);
Replace {module_api_name} and {FIELD_API_NAME} with the appropriate values for your specific use case. Please note that the FIELD_API_NAME should always be uppercase.
For example, to assign a value to a text field,
record.AddFieldValue(Com.Zoho.Crm.API.Record.Leads.LAST_NAME, "Last Name");
To assign a null value to the same text field.
record.AddFieldValue(Com.Zoho.Crm.API.Record.Leads.LAST_NAME, null);
Custom Fields:
To manage custom fields using CSharp SDK:
a. Import the Record Class:
- Com.Zoho.Crm.API.Record.Record record = new Com.Zoho.Crm.API.Record.Record();
b. Assign Values to Custom Fields:
The syntax for assigning values to standard fields uses the AddKeyValue method of the Record object:
- record.AddKeyValue("{field_api_name}", value);
Replace {field_api_name} with the appropriate values for your specific use case.
For example, to assign a value to a text field,
record.AddKeyValue("Single_Line_Field", "Text Single Line value");
To assign a null value to the same text field.
record.AddKeyValue("Single_Line_Field5", null);
Standard Fields:
a. Import the Field Class:
- import com.zoho.crm.api.record.Record
- import com.zoho.crm.api.record.Field.{Leads}
- val record = new Record
b. Assign Values to Standard Fields:
The syntax for assigning values to standard fields uses the addFieldValue method of the Record object:
- record.addFieldValue(new Field.{module_api_name}.{field_api_name}, "Field Value");
Replace {module_api_name} and {field_api_name} with the appropriate values for your specific use case.
For example, to assign a value to a text field,
record.addFieldValue(new Field.Leads().LastName, "Last Name")
To assign a null value to the same text field.
record.addFieldValue(new Field.Leads().LastName, null)
Custom Fields:
To manage custom fields using Scala SDK:
a. Import the Record Class:
- import com.zoho.crm.api.record.Record
- import com.zoho.crm.api.record.Field.{Leads}
- val record = new Record
b. Assign Values to Custom Fields:
The syntax for assigning values to standard fields uses the addKeyValue method of the Record object:
- record.addKeyValue("{field_api_name}", value);
Replace {field_api_name} with the appropriate values for your specific use case.
For example, to assign a value to a text field,
record.addKeyValue("Single_Line_Field", "Text Single Line value");
To assign a null value to the same text field.
record.addKeyValue("Single_Line_Field", null);
Standard Fields:
a. Import the Field Class:
- require 'ZOHOCRMSDK6_0'
- record = ZOHOCRMSDK::Record::Record.new
b. Assign Values to Standard Fields:
The syntax for assigning values to standard fields uses the add_field_value method of the Record object:
- record.add_field_value(ZOHOCRMSDK::Record::Field::{module_api_name}.{field_api_name}, "value")
Replace {module_api_name} and {field_api_name} with the appropriate values for your specific use case.
For example, to assign a value to a text field,
record.add_field_value(ZOHOCRMSDK::Record::Field::Leads.Last_name, "Last Name")
To assign a null value to the same text field.
record.add_field_value(ZOHOCRMSDK::Record::Field::Leads.Last_name, nil)
Custom Fields:
To manage custom fields using Ruby SDK:
a. Import the Record Class:
- require 'ZOHOCRMSDK6_0'
- record = ZOHOCRMSDK::Record::Record.new
b. Assign Values to Custom Fields:
The syntax for assigning values to standard fields uses the add_key_value method of the Record object:
- record.add_key_value("{field_api_name}", value);
Replace {field_api_name} with the appropriate values for your specific use case.
For example, to assign a value to a text field,
record.add_key_value("Single_Line_Field", "Text Single Line value");
To assign a null value to the same text field.
record.add_key_value("Single_Line_Field", nil);
Standard Fields:
a. Import the Field Class:
- import * as ZOHOCRMSDK from "@zohocrm/typescript-sdk-6.0";
- let record = new ZOHOCRMSDK.Record.Record();
b. Assign Values to Standard Fields:
The syntax for assigning values to standard fields uses the addFieldValue method of the Record object:
- await record.addFieldValue(ZOHOCRMSDK.Record.Field.{module_api_name}.{FIELD_API_NAME},value);
Replace {module_api_name} and {FIELD_API_NAME} with the appropriate values for your specific use case. Please note that the FIELD_API_NAME should always be uppercase.
For example, to assign a value to a text field,
await record.addFieldValue(ZOHOCRMSDK.Record.Field.Leads.LAST_NAME, "Last Name");
To assign a null value to the same text field.
await record.addFieldValue(ZOHOCRMSDK.Record.Field.Leads.LAST_NAME, null);
Custom Fields:
To manage custom fields using TypeScript SDK:
a. Import the Record Class:
- import * as ZOHOCRMSDK from "@zohocrm/typescript-sdk-6.0";
- let record = new ZOHOCRMSDK.Record.Record();
b. Assign Values to Custom Fields:
The syntax for assigning values to standard fields uses the addKeyValue method of the Record object:
- record.addKeyValue("{field_api_name}", value);
Replace {field_api_name} with the appropriate values for your specific use case.
For example, to assign a value to a text field,
record.addKeyValue("Single_Line_Field", "Text Single Line value");
To assign a null value to the same text field.
record.addKeyValue("Single_Line_Field", null);
Standard Fields:
a. Import the Field Class:
- let record = new ZCRM.Record.Model.Record();
b. Assign Values to Standard Fields:
The syntax for assigning values to standard fields uses the addFieldValue method of the Record object:
- record.addFieldValue(ZCRM.Record.Model.Field.{module_api_name}.{FIELD_API_NAME}, "value")
Replace {module_api_name} and {FIELD_API_NAME} with the appropriate values for your specific use case. Please note that the FIELD_API_NAME should always be uppercase.
For example, to assign a value to a text field,
record.addFieldValue(ZCRM.Record.Model.Field.Leads.LAST_NAME, "Last Name");
To assign a null value to the same text field.
record.addFieldValue(ZCRM.Record.Model.Field.Leads.LAST_NAME, null);
Custom Fields:
To manage custom fields using Javascript SDK:
a. Import the Record Class:
- let record = new ZCRM.Record.Model.Record();
b. Assign Values to Custom Fields:
The syntax for assigning values to standard fields uses the addKeyValue method of the Record object:
- record.addKeyValue("{field_api_name}", value);
Replace {field_api_name} with the appropriate values for your specific use case.
For example, to assign a value to a text field,
record.addKeyValue("Single_Line_Field", "Text Single Line value");
To assign a null value to the same text field.
record.addKeyValue("Single_Line_Field", null);
We hope this series has provided you with valuable insights into managing different field types in Zoho CRM using our diverse range of SDKs. Should you have any questions or require further assistance with any of our SDKs, or any other developer tools, please don't hesitate to reach out in the comments or via email at
support@zohocrm.com. Your feedback helps us improve and tailor our content to serve your needs better.
Thank you for being a part of our journey. Keep an eye out for more in-depth and developer-centric content in our Kaizen series, released every Friday!
Recommended Reads: