Hello everyone!
Welcome back to another week of Kaizen!
In this post, we will discuss the Layouts in Zoho CRM.
1. What are Layouts?
Layouts allow you to organize various fields of a module into sections. They also allow you to set layout-specific properties such as mandatory, unique, default, etc, to various fields. Every module has a default layout named "Standard". You can also create your own layouts for each module.
2. Adding a new layout to a module
You can get the details of a layout such as the ID, available sections, the visibility of the layout etc., via the Layouts Metadata API. Alternatively, you can go to Setup > Customization > Modules and Fields > Choose module > Choose layout to see the layout ID in the URL. 3. System-defined fields of the default modules
As we discussed in the previous section, you cannot modify the properties of system-defined fields in any layout of a module. Listed below are the system-defined fields of the default modules in Zoho CRM.
Module
| System-defined mandatory fields and field type
|
Leads
| Last Name - Single Line
|
Contacts
| Last Name - Single Line
|
Accounts
| Account Name - Single Line
|
Deals
| Deal Name - Single Line
Stage - Picklist
|
Tasks
| Subject - Multi Line
|
Calls
| Subject - Multi LIne
Call Type - Picklist
Call Start Time - Date/Time
Call Duration - Single Line
|
Events
| Title - Single Line
From - Date/Time
To - Date/Time
|
Products
| Product Name - Single Line
|
Quotes
| Subject - Single Line
Product Details - Product Line Item
|
Invoices
| Subject - Single Line
Product Details - Product Line Item
|
Campaigns
| Campaign Name - Single Line
|
Vendors
| Vendor Name - Single Line
|
Price Books
| Price Book Name - Single Line
Pricing Details
|
Cases
| Case Origin - Picklist
Status - Picklist
Subject - Single Line
|
Solutions
| Solution Title - Single Line
|
Purchase Orders
| Subject - Single Line
Vendor Name - Lookup
Product Details - Product Line Item
|
Sales Orders
| Subject - Single Line
Product Details - Product Line Item
|
4. Inserting Records in a Particular Layout
a. Via API
Before we look at how to insert a record in a particular layout via API, let us have a look at what happens when you specify and do not specify the layout details in the input.
When you specify layout details in the input:
1. The system checks for both system-defined and user-defined mandatory fields.
2. The default values for fields with default values will be auto-populated.
When you do not specify layout details in the input:
1. The system inserts the record in the "standard" layout of that module.
2. The system checks only for system-defined mandatory fields.
3. The default values for fields with default values will not be auto-populated.
Specify the unique layout ID in the input in the form of a JSON object named "Layout". The "id" key in the response of the layouts metadata API represents the unique ID of the layout.
Input
{
"data": [
{
"Company": "Zylker",
"Last_Name": "Daly",
"First_Name": "Paul",
"State": "Texas",
"Layout": {
"id": "4150868000000244014"
}
},
{
"Company": "Villa Margarita",
"Last_Name": "Dolan",
"First_Name": "Brian",
"State": "Texas"
}
]
}
|
|
Note:
- A single record cannot be added to multiple layouts. In this case, you must create a new record with the same details in the desired layout. A single record (with a unique record ID) cannot exist in more than one layout.
b. Via UI
To insert records in a particular module via UI, choose the layout before you insert a record in a module.
Note:
The Get Records API lists all the records from all the layouts. The key "layout" gives the details of the layout that the record belongs to.
5. Updating the layout details for a record via API
To update the layout details of a record via API, specify the layout details in the input. When you update the layout details of a record: - The system checks for both system-defined and user-defined mandatory fields in the layout that you update. For instance, if you update the layout of a lead from standard to custom, where "Company" is a mandatory field, then the lead must already have a value in the "Company" field, or you must specify it in the input. The system checks for both "Last_Name" (system-defined mandatory field) and "Company" (user-defined mandatory field) before updating the layout of the record.
- The system auto-populates the fields with their default values (if applicable) in the layout that you update.
We hope you found this post useful. Please reach out to us at support@zohocrm.com if you have questions, or let us know in the comment section.
Cheers!