从 Zoho Invoice 获取记录

 概述

可执行 zoho.invoice.getrecords() 任务以便从 Zoho Invoice 的任何受支持模块提取记录。通过将它放入 Zoho Creator 中所需的表单动作块,从 Zoho Invoice 提取记录的过程可以根据需求轻松地实现自动化。假设我们有一个 Zoho Creator 表单,它需要从 Zoho Invoice 提取记录以采取进一步动作,例如,执行迭代。您可以在所需的表单动作块执行 zoho.invoice.getrecords() 任务,它将返回包含映射格式记录的响应。有关如何执行此任务的更多详情在下面说明。

 支持的模块

  • 发货单
  • 客户付款
  • 产品
  • 联系人
  • 费用
  • 报价单
  • 费用类别

 语法

response =zoho.invoice.getrecords(moduleName, organisation_id, filter_by, search_text, sort_column)

其中,
<response> - 是作为响应由 Zoho Invoice 返回的映射变量。
<moduleName> - Zoho Invoice 中的模块名称,记录将从这里提取。(必填)
<organisation_id> - 从中提取记录时必需的机构编号(必填)。下面是显示了示例机构编号的图像。

filter_by 允许按状态筛选记录(模块特定)。点击此处转至 <module> -><list module> 以了解更多信息。示例:联系人 -> 列出联系人。
search_text - 基于搜索关键词来搜索记录(模块特定)。点击此处转至 <module> -><list module> 以了解更多信息。示例:联系人 -> 列出联系人。
sort_column - 按字母顺序排序一列记录(模块特定)。点击此处转至 <module> -><list module> 以了解更多信息。示例:联系人 -> 列出联系人。

 示例

下面是一个示例脚本,可添加到 Zoho Creator 表单中以从 Zoho Invoice 提取记录。假设我们有一个 Creator 表单,我们需要从 Zoho Invoice 将记录提取到该表单中以执行迭代。您可以将以下脚本添加到 Creator 表单中的所需表单动作块,以便每当加载、编辑或提交此表单时,Zoho Invoice 的指定模块中的现有记录会相应地取回。在本例中,模块是“联系人”。当执行以下脚本时,会从 Zoho Invoice 中指定的机构编号提取所有记录。

response = zoho.invoice.getrecords("Contacts", "10982991");

其中,
response - 是作为响应由 Zoho Invoice 返回的映射变量。
Contacts - Zoho Invoice 中的模块名称,记录将从这里提取。
10982991 - 示例机构编号,记录将从中提取。

 响应

Zoho Invoice 作为映射返回的响应:

{
"code": 0,
"message": "success",
"contacts": [
{
"contact_id": "219715000000050001",
"contact_name": "Bala",
"company_name": "Bowman and Co",
"contact_type": "customer",
"status": "active",
"source": "api",
"is_linked_with_zohocrm": false,
"payment_terms": 15,
"payment_terms_label": "Net 15",
"currency_id": "219715000000000099",
"currency_code": "INR",
"outstanding_receivable_amount": 0,
"unused_credits_receivable_amount": 0,
"first_name": "Will",
"last_name": "Smith",
"email": "willsmith@bowmanfurniture.com",
"phone": " 1-925-921-9201",
"mobile": " 1-4054439562",
"created_time": "2015-11-30T16:25:32+0530",
"last_modified_time": "2015-11-30T16:29:34+0530"
}
],
"page_context": {
"page": 1,
"per_page": 200,
"has_more_page": false,
"report_name": "Contacts",
"applied_filter": "Status.All",
"sort_column": "contact_name",
"sort_order": "A"
}
}

失败响应:

{"message":"This user is not associated with the organization_id:11529358.","code":6041}