File = list();//定义一个List集合
relatedrcords = zoho.crm.getRelatedRecords("Attachments","Leads","4939598000001046062");//获取记录的附件
for each ele in relatedrcords
{
attachementId = ele.get("id");//拿到附件ID
attachementname = ele.get("File_Name");
info attachementId;
info attachementname ;
downloadFile = invokeurl
[
type :GET
connection:"crm"
response-decoding:"UTF-8"//务必添加格式为UTF-8。否则下载的附件名称为乱码
];
info downloadFile;//获取附件
File.add(downloadFile);//将附件添加到最初定义的List集合当中
}
sendmail
[
from :zoho.adminuserid
subject :"Subject of the email"
message :"Your message"
content type :HTML
Attachments :file:File//附件
]