I have a problem linking task with Invoice in zoho php API

121 Views Asked by At

I have written a code in php zoho api which create task and assign it to the invoice.

Create task is working fine and its creating task into zoho panel but its not linking with the invoice.

Please find below code:

$crmid = "3051265000001316001"; // customer id
$realted_to_id = "3051265000003854220"; // invoice id
$task_data = array(
    'Subject' => "New Invoice - 22", 
    'Due Date' => date('Y-m-d',strtotime("10-10-2020")),
    'Status' => "In Progress",
    'Priority' => "High",
    'CONTACTID' => $crmid,
    'RELATEDTOID' => $realted_to_id,
    'Related To' => "HO000001",
    'SEMODULE' => "CustomModule5001",
);

/* Insert Task in zoho */
$task = $zoho_api->insert_record('Tasks', $task_data);

To link Task with Invoice, I'm using two fields RELATEDTOID and Related To but its not linking :(

There is no error message coming.

Could anyone help on this please?

Thanks

1

There are 1 best solutions below

0
On

For everyone who are seeking to get answer of this.

In v1 api, please provide the invoice records details in xmlData as "<FL 
val="SEMODULE">Invoices</FL> <FL val="SEID">{Invoice_record_id}</FL>".

In v2 api, Please provide the invoice details in JSON body as ("$se_module": 
"Invoices", "What_Id": "{Invoice_record_id}").

@ZOHO developer community seems poor to answer this question.