通过Zoho Creator在Zoho书籍中创建销售订单

发布于 2025-02-08 10:07:09 字数 1405 浏览 2 评论 0原文

我正在尝试在Zoho创建者中构建一个简单的应用程序,其中一个人输入销售订单的数据。必须将其转化为Zoho书籍,以及通过Zoho Books发送的手动订单的整合。

我已经完成了此链接中提到的每一个步骤: https://githorkflowaub.com/theworkflowacademy e /zoho-books-custom-connections

加上Zoho在这里告诉的任何内容: https://help.zoho.com/portal/en/communital/community/topic/topic/topic/integreat-03-integrat-zoho-zoho-zoho-cereator-with--zoho-with-zoho-books

这是我的代码:

listVar = List();

//iterating each row in the subform
for each line in Items_to_Order
{
  mapVar = map();
  mapVar.put("item_id", line.Item_ID);
  mapVar.put("name", line.Item_Name);
  mapVar.put("rate", line.Price);
  mapVar.put("quantity", line.Quantity);
  listVar.add(mapVar);
}

values = map();
values.put("customer_id", input.Sales_Order_ID);
values.put("line_items", listVar);
response = invokeurl
[
    url : "https://books.zoho.com/api/v3/salesorders?organization_id=762389459"
    type :POST
    parameters:mapVar
    connection:"zoho_books"
    detailed:true
];

// To see all headers and content
info response;

I am trying to build a simple application in Zoho Creator where a person inputs the data of a sales order. This has to be translated into Zoho Books along with the integration of the manual orders sent via Zoho Books.

I have done every single step mentioned in this link: https://github.com/TheWorkflowAcademy/Zoho-Books-Custom-Connections

Plus whatever Zoho is telling here: https://help.zoho.com/portal/en/community/topic/integreat-03-integrating-zoho-creator-with-zoho-books

Here is my code:

listVar = List();

//iterating each row in the subform
for each line in Items_to_Order
{
  mapVar = map();
  mapVar.put("item_id", line.Item_ID);
  mapVar.put("name", line.Item_Name);
  mapVar.put("rate", line.Price);
  mapVar.put("quantity", line.Quantity);
  listVar.add(mapVar);
}

values = map();
values.put("customer_id", input.Sales_Order_ID);
values.put("line_items", listVar);
response = invokeurl
[
    url : "https://books.zoho.com/api/v3/salesorders?organization_id=762389459"
    type :POST
    parameters:mapVar
    connection:"zoho_books"
    detailed:true
];

// To see all headers and content
info response;

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

暗恋未遂 2025-02-15 10:07:09

确保您在地图上传递了正确的值,line.item_id必须是书籍上项目的ID,对于“ customer_id”。并检查您是否有其他必需的参数,例如“参考_number”,如果它自动生成。如果您确定正确设置了急救,可以粘贴响应结果吗?

Make sure you're passing the right values on your map, line.Item_ID must be the ID of your item on books, same for "customer_id". and check whether you have any other required parameter such as "Reference_number" if its automatically generated or not. If you're sure everithing is set correctly, can you just paste the response outcome?

一个人的夜不怕黑 2025-02-15 10:07:09

我知道我参加聚会有点迟了 - 但是我注意到您正在调用URL并通过[MAPVAR]来获取参数。您不应该通过[值]吗?

[MAPVAR]是您要添加到[ListVar]列表的每个订单项的临时地图。然后,您可以创建一个新的地图[值],然后将[ListVar]添加为“ List_items”。

看起来您构建了所有内容,但是当您调用时,您只是传递原始[MAPVAR](单个行项目)而不是[值]

I know I'm a little late to the party - but I notice that you're invoking the URL and passing [mapVar] for the parameters. Shouldn't you be passing [values]?

[mapVar] is your temporary map for each line item that you're adding to [listVar] list. You then create a new map [values] and add [listVar] to it as 'list_items'.

It looks like you built everything right, but when you invokeUrl, you're only passing the original [mapVar] (a single line item) instead of [values]

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文