【问题标题】:How to create custom function in zoho crm?如何在 zoho crm 中创建自定义功能?
【发布时间】:2016-08-25 09:51:26
【问题描述】:

请帮助我如何创建自定义功能以从 zoho crm 中的自定义模块中搜索记录。

我是 zoho crm 的新手,所以我不知道如何为此编写代码。 工作流在事件创建时触发。

在自定义模块中,LEADID 被插入到 Lead Id 字段中,我想通过自定义模块中的 Lead Id 字段值搜索记录。 在函数中,我传递了搜索记录的潜在客户 ID。 下面是我创建的示例代码,但它不起作用。

Lead_id=input.LeadID.toString();
Event_id=input.EventID.toString();
rec = zoho.crm.getRecordById("Events",input.EventID);
resp = zoho.crm.searchRecords("CustomModule1","Lead Id",input.LeadID);
for each ele in resp
{
mp=map();
mp.put("Event Created Time",rec.get("Created Time"));
contactId=ele.get("CUSTOMMODULE1_ID");
updateResp = zoho.crm.updateRecord("CustomModule1",contactId,mp);
}

【问题讨论】:

  • 您想从 Lead 获取相关事件?

标签: zoho


【解决方案1】:

这里是示例 API 方法,使用 Lead ID 从 Lead 模块获取记录的代码

$auth = "*************************";// Auth Keys
$id="****************";// Record Id

////////////get data by Id from Zoho Lead Module ///////////
$get_url = "https://crm.zoho.com/crm/private/json/Leads/getRecordById?";
$get_query = "authtoken=".$auth."&scope=crmapi&id=".$id."";

$get_curl = curl_init();
curl_setopt($get_curl, CURLOPT_URL, $get_url);
curl_setopt($get_curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($get_curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($get_curl, CURLOPT_TIMEOUT, 60);
curl_setopt($get_curl, CURLOPT_POST, 1);
curl_setopt($get_curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($get_curl, CURLOPT_POSTFIELDS, $get_query);
$get_response = curl_exec($get_curl);
$jfo = json_decode($get_response);
echo "<pre>";
curl_close($get_curl);
print_r($jfo);

【讨论】:

    猜你喜欢
    • 2021-06-06
    • 2021-08-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-15
    • 1970-01-01
    相关资源
    最近更新 更多