模块之间左侧相关列表附件传递

模块之间左侧相关列表附件传递

a = zoho.crm.getRelatedRecords("relatedlist","Cases",id);
for each  resp in a
{
Dispatchlist_id = resp.get("id").toString();
//获取表单ID
//Listofattachments:获取附件列表数据
Listofattachments = invokeurl
[
url :"https://www.zohoapis.com.cn/crm/v2/CustomModule1/%22 + Dispatchlist_id + "/Attachments"
type :GET
connection:"xycblueprints"
];
//循环附件数据
for each  fileid_fault in Listofattachments.getJSON("data")
{
fileid_id = fileid_fault.get("id");
//附件ID
file_name = fileid_fault.get("File_Name");
//附件名称
//response:下载附件数据
response = invokeurl
[
url :"https://www.zohoapis.com.cn/crm/v2/CustomModule1/%22 + Dispatchlist_id + "/Attachments/" + fileid_id + ""
type :GET
connection:"xycblueprints"
];
response.setFileName("" + file_name + "");
//不加这一步附件名称将是乱码,加上即可正常显示名称。
resp = zoho.crm.attachFile("Cases",id,response);
//更新到对应模块
}
}