重定向至"Zoho匹配客户记录与洪水功能"诊断树



我正在尝试通过iframe将Zoho CRM嵌入到一个只知道电话号码的应用程序中。

(Ramble:最初我打算调用 Zoho api 通过电话号码查找联系人并重定向或加载联系人的 Zoho 页面 - 但托管应用程序似乎不支持足够的功能来适应 Zoho 的仅限 OAuth2 的身份验证 - 所以我想我被 Zoho 洪水困住了,我发现这是一种 ATROCIOUS 语言(

我希望以电话号码作为参数导航到此Zoho功能,使其找到唯一匹配项,然后重定向到客户详细信息。

response = zoho.crm.searchRecords(
"Contacts", 
"", // no criteria - I hope the later parameter 
// normalizes better than this would?
1, // first page
2, // of two max results - just to verify uniqueness
"{ phone: '" + phoneNumber + "'}"); // Docs are terrible.  Is this the format? 
// I also tried "phone:equal:..."
//if (1 < response.size()) { // script errors show up on nonsense line 
//  return "[Ambiguous]";    // numbers, but this seems to work until later
//}                          // lines are included - then errors point here
return response; // Works, but useless string output
return response.firstName; // "Invalid collection object found" - but not expected to work
return response.get(0); // 'TEXT' can not be cast to '[KEY-VALUE, TEXT, LIST]' for the function 'get'
return response.get('firstName'); // 'TEXT' can not be cast to '[KEY-VALUE, TEXT, LIST]' for the function 'get'
return response.get(0).firstName; // Improper Statement Error might be due to missing ';' at end of the line or incomplete expression
// openUrl( <string>, <window_type> ); // hoping to get here

我还尝试了从每个元素循环内部返回的变化,没有运气。

我想我已经通过电话号码成功找到了用户,因为我认为我确实得到了一个匹配项,但我无法验证它,我不知道如何为 openUrl(( 调用派生客户详细信息页面的 URL。 你知道如何在这方面取得进展吗?

条件格式不正确,函数searchRecords返回映射列表。

要访问 al list 的第一个元素,您必须使用 .get(0( 并获取映射 .get("First_Name"( 的元素

字段格式不正确,您必须获取字段形式的

API 名称 crm.zoho.com->setup->API->API 名称->联系人可以使用info来调试响应(信息响应;(

卓禾客户关系管理接口 搜索记录

toReturn = "";
response = zoho.crm.searchRecords("Contacts", "Phone:equals:" + phoneNumber, 1, 2);
if (1 < response.size()) {
toReturn = "[Ambiguous]";
} else if (0 == response.size()) {//error triggered if use get(0) of emty list
toReturn = "[None]";
}else {
toReturn = reponse.get(0).get("First_Name");
openUrl("https://crm.zoho.com/crm/org[yourOrgID]/tab/Contacts/" + reponse.get(0).get("id"), "new window");
}
return toReturn;

最新更新