Update Related Record in Zoho CRM V8

Note:

  • Each time the zoho.crm.v8.updateRelatedRecord integration task is executed, it triggers an API request in the back-end. This call is deducted from the external calls limit available for the service from which the task is executed, based on your pricing plan.
  • Only actual executions that receive a response (whether success or failure) are counted, not the number of times the task appears in the script. For example, if zoho.crm.v8.updateRelatedRecord integration task is placed inside a for each task that iterates five times, the number of external calls consumed will be five, even though the task appears only once in the script. 

Overview

This task is used to update a record in a submodule related to a record in a parent module in Zoho CRM. For example, a record from the submodule “Price books” which is related to the parent module “Products”, can be updated using this task. You can find all the other supported relations in Zoho CRM API document.

Syntax

<variable> = zoho.crm.v8.updateRelatedRecord(<sub_module>, <sub_module_record_id>, <parent_module>, <parent_module_record_id>, <values>, <connection>);

where,

ParameterData typeDescription
<variable>KEY-VALUEHolds the response returned by Zoho CRM on successful task execution or error details on failure. Here it represents the record's modification details.
<sub_module>TEXTSpecifies the API name of the sub module in which the record will be updated.
<sub_module_record_id>NUMBER

Specifies the ID of the sub module record that needs to be updated.

The record ID of the related records can be obtained from the response of Get Related Records task.

<parent_module>TEXTSpecifies the API name of the parent module to which the sub module belongs.
<parent_module_record_id>NUMBER

Specifies the ID of the parent module record whose related record needs to be updated.

Learn how to retrieve the unique record ID from the response returned by Zoho CRM 
after creating, searching, or fetching a record.

<values>KEY-VALUESpecifies the field values that will overwrite the existing values in the related module record.
<connection>TEXT

Represents the link name of the connection which is connected to your Zoho CRM account.

Note:

Example

The following script updates the field - list_price of the sub module - Price_Books which belongs to the parent module - Products.

response = zoho.crm.v8.updateRelatedRecord("Price_Books",2303XXXXXXXXXXXXXXX,"Products",4770XXXXXXXXXXXXXXX,{"list_price":200});

where,

response
is the variable which holds the response returned by Zoho CRM. Here it represents the modification information of the record.
"Price_Books"
is the TEXT that represents the API name of the sub module in which the record needs to be updated.
2303XXXXXXXXXX
is the NUMBER that represents the ID of the sub module record that needs to be updated.
"Products"
is the TEXT that represents the API name of the parent module to which the sub module belongs.
4770XXXXXXXXXX
is the NUMBER that represents the ID of the parent record.

Note: Refer this page for the instructions to get API names of the CRM modules and fields.

Response Format

Success Response

The success response returned is of the following format

{
 "Modified_Time":"2018-12-11T12:15:02+05:30",
 "Modified_By":{"name":"John","id":"2303XXXXXXXXXX"},
 "Created_Time":"2018-12-06T19:01:45+05:30",
 "id":"2303XXXXXXXXXX",
 "Created_By":{"name":"John","id":"2303XXXXXXXXXX"}
}

Failure Response

The failure response returned for incorrect or non-existent record ID is of the following format

{
 "code":"INVALID_DATA",
 "details":{},
 "message":"the related id given seems to be invalid",
 "status":"error"
}