Getting Related Records

You can fetch related information (Notes, Tasks, Contacts, etc.) about a record in an Extension or Vertical Solution using the zoho.crm.getRelatedRecords() deluge task.

Syntax

<Response> = zoho.crm.getRelatedRecords(<module String>,<parentModuleName String>,<recordId Long>,<page Long>,<perPage Long>);

where,
<Response> is the task response returned as a List.

Parameters

NameDatatypeDescriptionMandatory
moduleStringSpecify the API name of the related list whose entries you want to fetch.Yes
parentModuleNameStringSpecify the API name of the module whose related list information you want to fetch.Yes
recordIdLongIt is the unique ID of the parent record whose related list information you want to fetch.Yes
pageLongIt indicates the page number from which you want to retrieve records. The default value is 1.No
perPageLongIt specifies the number of records that need to be fetched per page. The default value is 200.No

Example

Fetch the notes associated with a given Lead record with ID 3388926000000310005.

response = zoho.crm.getRelatedRecords("Notes","Leads",3388926000000310005,1,3);
info response;

Here Leads is the parentModuleName and Notes is the related module.

Response Format

{"Owner":{"name":"ZohoTest","id":"3388926000000166021"},"Modified_Time":
"2018-10-24T13:47:52+05:30","$attachments":null,"Created_Time":
"2018-10-24T13:47:52+05:30","Parent_Id":{"name":"Mary John",
"id":"3388926000000310005"},"$editable":true,"$se_module":"Leads",
"Modified_By":{"name":"ZohoDemo","id":"3388926000000166021"},"$size":null,
"$voice_note":false,"id":"3388926000000311004","Created_By":{"name":"ZohoTest",
"id":"3388926000000166021"},"Note_Title":null,"Note_Content":"This is a sample note"}

 Related Links

https://www.zoho.com/crm/help/api/v2/#related-list-api