Kaizen #40 - System-defined fields and their default values in Leads #API

Kaizen #40 - System-defined fields and their default values in Leads #API

Hello everyone!

Welcome back to another post in the Kaizen series!
This week, we will discuss the system-defined fields and their default values in the Leads module in Zoho CRM.

We will cover the following in this post:
  1. System-defined non-mandatory fields and their default values
  2. System-defined mandatory fields

What are the system-defined fields in a module?
The fields that are available by default in a module, are system-defined fields. You can choose to set values to these fields, or the system assigns the default value for applicable fields.

How can you find which fields are system-defined?
Use the Fields Metadata API. The response contains all the fields available in that module for your org.
The boolean value of the key custom_field indicates whether the field is system-defined or a custom field in that module. The value "true" indicates that the current field is a custom field, and the value "false" indicates that the current field is a system-defined field.

System-defined mandatory fields
Few system-defined fields are mandatory. If left unspecified, the system throws the MANDATORY_NOT_FOUND error.
The boolean value of the key system_mandatory indicates whether the field is mandatory in that module. The value "true" indicates that the current field is a system-defined mandatory field, and the value "false" indicates that the current field is not a system-defined mandatory field.

Note
We cannot modify the properties of a few system-defined fields. Ex: Last_Name in Leads.

Fields Metadata API for the Leads Module

Sample Request
Request URL: {{api-domain}}/crm/v2/settings/fields?module=Leads
Request Method: GET

Sample Response
{
    "fields": [
        {
            "system_mandatory": false,
            "webhook": true,
            "json_type": "jsonobject",
            "crypt": null,
            "field_label": "Lead Owner",
            "tooltip": null,
            "created_source": "default",
            "field_read_only": true,
            "display_label": "Lead Owner",
            "read_only": false,
            "association_details": null,
            "businesscard_supported": true,
            "multi_module_lookup": {},
            "currency": {},
            "id": "949200000000000553",
            "custom_field": false,
            "lookup": {},
            "visible": true,
            "length": 120,
            "view_type": {
                "view": true,
                "edit": true,
                "quick_create": false,
                "create": true
            },
            "subform": null,
            "api_name": "Owner",
            "unique": {},
            "data_type": "ownerlookup",
            "formula": {},
            "decimal_place": null,
            "mass_update": false,
            "multiselectlookup": {},
            "pick_list_values": [],
            "auto_number": {}
        },
        {
            "system_mandatory": false,
            "webhook": true,
            "json_type": "string",
            "crypt": null,
            "field_label": "Company",
            "tooltip": null,
            "created_source": "default",
            "field_read_only": false,
            "display_label": "Company",
            "read_only": false,
            "association_details": null,
            "quick_sequence_number": "1",
            "businesscard_supported": false,
            "multi_module_lookup": {},
            "currency": {},
            "id": "949200000000000555",
            "custom_field": false,
            "lookup": {},
            "visible": true,
            "length": 100,
            "view_type": {
                "view": true,
                "edit": true,
                "quick_create": true,
                "create": true
            },
            "subform": null,
            "api_name": "Company",
            "unique": {},
            "data_type": "text",
            "formula": {},
            "decimal_place": null,
            "mass_update": true,
            "multiselectlookup": {},
            "pick_list_values": [],
            "auto_number": {}
        },
        {
            "system_mandatory": true,
            "webhook": true,
            "json_type": "string",
            "crypt": null,
            "field_label": "Last Name",
            "tooltip": null,
            "created_source": "default",
            "field_read_only": false,
            "display_label": "Last Name",
            "read_only": false,
            "association_details": null,
            "quick_sequence_number": "3",
            "businesscard_supported": false,
            "multi_module_lookup": {},
            "currency": {},
            "id": "949200000000000559",
            "custom_field": false,
            "lookup": {},
            "visible": true,
            "length": 80,
            "view_type": {
                "view": false,
                "edit": true,
                "quick_create": true,
                "create": true
            },
            "subform": null,
            "api_name": "Last_Name",
            "unique": {},
            "data_type": "text",
            "formula": {},
            "decimal_place": null,
            "mass_update": false,
            "multiselectlookup": {},
            "pick_list_values": [],
            "auto_number": {}
        },
        {
            "system_mandatory": false,
            "private": null,
            "webhook": true,
            "json_type": "jsonobject",
            "crypt": null,
            "field_label": "Related Users",
            "tooltip": null,
            "created_source": "default",
            "field_read_only": false,
            "display_label": "User",
            "read_only": false,
            "association_details": null,
            "businesscard_supported": false,
            "multi_module_lookup": {},
            "currency": {},
            "id": "4150868000000625001",
            "custom_field": true,
            "lookup": {},
            "visible": true,
            "length": 50,
            "view_type": {
                "view": true,
                "edit": true,
                "quick_create": false,
                "create": true
            },
            "subform": null,
            "api_name": "User",
            "unique": {},
            "data_type": "userlookup",
            "formula": {},
            "decimal_place": null,
            "mass_update": false,
            "multiselectlookup": {},
            "pick_list_values": [],
            "auto_number": {}
        },
...
]
}

System-defined non-mandatory fields and their default values
The following table gives the list of all the system-defined non-mandatory fields in the Standard Layout of the Leads module.

Field API Name
JSON Type
CRM Data Type
Default Value
Owner
JSON Object
Lookup
Name and ID of the current user
Company
String
Single Line
null
First_Name
String
Single Line
null
Salutation
String
Picklist
None
Email
String
Email
null
Full_Name
String
--
null
Phone
String
Phone
null
Mobile
String
Phone
null
Designation
String
Text
null
Lead_Status
String
Picklist
null
Fax
String
Phone
null
Website
String
URL
null
Lead_Source
String
Picklist
null
No_of_Employees
Integer
Number
null
Industry_Type
String
Picklist
null
Rating
String
Picklist
None
Tag
JSON Array
--
null
Annual_Revenue
Double
Currency
null
Created_By (not editable)
JSON Object
--
Name and ID of the current user
Email_Opt_Out
Boolean
Checkbox
false
Skype_ID
String
Single Line
null
Modified_By
(not editable)
JSON Object
--
Name and ID of the user who last modified the record last
Created_Time
(not editable)
String
--
The date and time at which the record was created
Secondary_Email
String
Email
null
Modified_Time
(not editable)
String
--
The date and time at which the record was last modified
Twitter
String
Single Line
null
Last_Activity_Time
(not editable)
String
--
The date and time at which the record was used last
Converted_Date_Time
String
--
The date and time at which the lead or quote was converted
Street, City, State, Zip_Code, Country
String
Single Line
null
Description
String
Multi-line
null
Record_Image
String
--
null
You can refer to the Sample Attributes section of our Insert Records API for an example on adding values to the above fields.

System-defined mandatory field for the Leads module:
Field API Name
JSON Type
CRM Data Type
Default Value
Last_Name
String
Single Line
Not applicable

Note
  • In the Fields Metadata API, the value true for the key "field_read_only" indicates that it is read-only always.
  • The value true for the key "read_only" indicates that the key is read-only for the viewing user's profile. You can set the properties of such fields based on the profile. A user without the desired profile cannot edit these fields through an API.
  • You cannot modify the properties of system-defined mandatory fields in any module.
  • You can choose to alter the properties of the system-defined(non-mandatory) or custom fields in standard/custom layouts. The details of all the fields in all the layouts will be retrieved in the fields metadata API response.
  • You can also choose to set default values for fields with CRM field types—picklist, multi-select picklist, and checkbox.
We hope you found this post useful. Write to us at support@zohocrm.com if you have any questions, or let us know in the comment section.

Cheers!

Previous 'Kaizen' - Deals #API

    Access your files securely from anywhere

        Zoho Developer Community




                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation


                                              Manage your brands on social media



                                                    Zoho TeamInbox Resources

                                                      Zoho DataPrep Resources



                                                        Zoho CRM Plus Resources

                                                          Zoho Books Resources


                                                            Zoho Subscriptions Resources

                                                              Zoho Projects Resources


                                                                Zoho Sprints Resources


                                                                  Qntrl Resources


                                                                    Zoho Creator Resources



                                                                        Zoho Campaigns Resources


                                                                          Zoho CRM Resources

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • Functions

                                                                            Functions

                                                                          • Meetups

                                                                            Meetups

                                                                          • Kbase

                                                                            Kbase

                                                                          • Resources

                                                                            Resources

                                                                          • Digest

                                                                            Digest

                                                                          • CRM Marketplace

                                                                            CRM Marketplace

                                                                          • MVP Corner

                                                                            MVP Corner





                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now