Searching Records
Table of Contents
You can search records of a module in Extensions and Vertical Solutions using the zoho.crm.searchRecords() deluge task.
Syntax
<Response> = zoho.crm.searchRecords(<module String>,<criteria String>,<page Long>,<perPage Long>);
where,
<Response> is the task response returned as a List.
Parameters
Name | Datatype | Description | Mandatory |
module | String | Specify the API name of the module in which you want to perform the search. | Yes |
criteria | String | It is search criteria based on which the records will be fetched. | Yes |
page | Long | It indicates the page number from which you want to retrieve records. The default value is 1. | No |
perPage | Long | It specifies the number of records that need to be fetched per page. The default value is 200. | No |
Example
In the Accounts module, search for Accounts with the name 'Acme' and which belongs to an Industry with name that begins with 'Storage'.
searchResp = zoho.crm.searchRecords("Accounts","((Account_Name:equals:Acme) and (Industry:starts_with:Storage))",1,10);
info searchResp;
Provide the search criteria in string format as ((Account_Name:equals:Acme) and (Industry:starts_with:Storage)). The API name of the columns (Account_Name, Industry) have to be used. Use the Refer Fields in the Deluge Script Editor to know these names.
Response Format
{"Owner":{"name":"ZohoTest","id":"3388926000000166021"},"Ownership":null,
"Description":null,"$currency_symbol":"$","Account_Type":null,"Rating":null,
"SIC_Code":null,"Shipping_State":"Tamil Nadu","Website":null,"Employees":null,
"Last_Activity_Time":"2018-10-25T16:24:35+05:30","Industry":"Storage Equipment",
"Record_Image":null,"Modified_By":{"name":"Zoho Demo","id":"3388926000000166021"},
"Account_Site":null,"$process_flow":false,"Phone":null,"Billing_Country":"India",
"Account_Name":"Acme","id":"3388926000000297008","Account_Number":"0","$approved":true,
"Ticker_Symbol":null,"$approval":{"delegate":false,"approve":false,"reject":false,
"resubmit":false},"Modified_Time":"2018-10-25T16:24:35+05:30","Billing_Street":"27/2727",
"Created_Time":"2018-10-22T10:01:12+05:30","$editable":true,"Billing_Code":"682020",
"Parent_Account":null,"Shipping_City":"Chengalpattu","Shipping_Country":"India",
"Shipping_Code":"603202","Billing_City":"Kochi","Billing_State":"Kerala","Tag":[],
"Created_By":{"name":"ZohoTest","id":"3388926000000166021"},"Fax":null,
"Annual_Revenue":null,"Shipping_Street":"Estancia IT Park, Plot No. 140 & 151 GST Road"}
Note
The CRM task for searching records by PDC (zoho.crm.searchRecordsByPDC()) has been deprecated.