Choose where you’d like to start

Update Related Record

Description

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 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.updateRelatedRecord(<sub_module>, <sub_module_record_id>, <parent_module>, <parent_module_record_id>, <values>, <connection>);

where,

ParamsData typeDescription

<variable>

KEY-VALUE

specifies the response message returned by Zoho CRM. It represents the record's creation and modification details against the API names of the respective fields.

<sub_module>

TEXT

specifies 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>

TEXT

specifies 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 fetch the ID of a record after creatingsearching or fetching it.

<values>

KEY-VALUE

specifies the new values of the sub module record.

<connection>

(Optional)

TEXT

specifies the name of the connection

Note: The <connection> field is not employed in Zoho Creator.

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.updateRelatedRecord("Price_Books",2303XXXXXXXXXXXXXXX,"Products",4770XXXXXXXXXXXXXXX,{"list_price":200});

where,

response
variable which will hold the response returned by Zoho CRM, which represents the creation and 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"
     }

Related Links

Get Started Now

Execute