如何连接Zoho Flow自定义洪水功能?我一直遇到错误57(未经授权的访问)

发布于 2025-02-02 17:02:49 字数 1883 浏览 3 评论 0 原文

我正在研究一个涉及Zoho流的项目。我们创建了一个自定义功能,该功能应根据销售订单更新项目库存和状态。但是,当我尝试运行它时,我会收到错误57(未经授权的访问)。我尝试了多件事,但它仍然不起作用。当我测试它时,连接似乎还不错,但是它仍然可以运行。

请参阅下面的代码:

string Update_stock_or_change_inactive_item(string salesOrderId, string organization)
{
output = "";
salesOrder = zoho.inventory.getRecordsByID("SalesOrders",organization,salesOrderId);
output = salesOrder + " ";
productDetails = ifnull(salesOrder.get("line_items"),"");
lineitems = productDetails.toJSONList();
for each  item in lineitems
{
    itemMap = item.toMap();
    productId = ifnull(itemMap.get("product_id"),"");
    productName = ifnull(itemMap.get("name"),"");
    quantity = ifnull(itemMap.get("quantity"),"0");
    product = zoho.inventory.getRecordsByID("Items",organization,productId);
    productMap = product.toMap();
    //get product stock
    availableStock = ifnull(productMap.get("actual_available_stock"),"0");
    availableStockForSale = ifnull(productMap.get("actual_available_for_sale_stock"),"0");
    status = ifnull(productMap.get("status"),"");
    output = output + status;
    //check and update stock
    if(availableStock < quantity || availableStockForSale < quantity)
    {
        //update item to ensure that it is in stock
        new_values = Map();
        new_values.put("actual_available_stock",quantity);
        new_values.put("actual_available_for_sale_stock",quantity);
        new_values.put("status","active");
        response = zoho.inventory.updateRecord("Items",organization,productId,new_values);
        output = output + productName + " - stock updated to " + quantity + ", ";
    }
    else if(status != "active")
    {
        new_values.put("status","active");
        output = output + productName + " - status updated to active, ";
    }
    else
    {
        output = output + productName + " stock not updated, ";
    }
}
return output;
}

I am working on a project that involves Zoho Flow. We created a custom function that should update the item stock and status based on the sales order. However, when I try to run it I get error 57 (Unauthorized Access). I've tried multiple things and it still doesn't work. The connection seems fine when I tested it but it still work run.

See code below:

string Update_stock_or_change_inactive_item(string salesOrderId, string organization)
{
output = "";
salesOrder = zoho.inventory.getRecordsByID("SalesOrders",organization,salesOrderId);
output = salesOrder + " ";
productDetails = ifnull(salesOrder.get("line_items"),"");
lineitems = productDetails.toJSONList();
for each  item in lineitems
{
    itemMap = item.toMap();
    productId = ifnull(itemMap.get("product_id"),"");
    productName = ifnull(itemMap.get("name"),"");
    quantity = ifnull(itemMap.get("quantity"),"0");
    product = zoho.inventory.getRecordsByID("Items",organization,productId);
    productMap = product.toMap();
    //get product stock
    availableStock = ifnull(productMap.get("actual_available_stock"),"0");
    availableStockForSale = ifnull(productMap.get("actual_available_for_sale_stock"),"0");
    status = ifnull(productMap.get("status"),"");
    output = output + status;
    //check and update stock
    if(availableStock < quantity || availableStockForSale < quantity)
    {
        //update item to ensure that it is in stock
        new_values = Map();
        new_values.put("actual_available_stock",quantity);
        new_values.put("actual_available_for_sale_stock",quantity);
        new_values.put("status","active");
        response = zoho.inventory.updateRecord("Items",organization,productId,new_values);
        output = output + productName + " - stock updated to " + quantity + ", ";
    }
    else if(status != "active")
    {
        new_values.put("status","active");
        output = output + productName + " - status updated to active, ";
    }
    else
    {
        output = output + productName + " stock not updated, ";
    }
}
return output;
}

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

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

发布评论

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

评论(1

治碍 2025-02-09 17:02:49

使用内置的洪水集成功能时,您需要使用连接链接名称进行身份验证。有关更多详细信息,请参阅以下链接:

zoho flow:嵌入app connections in Invokeurl任务

When using the built-in Deluge integration function, you need to use the connection link name for authentication. For more details, refer to the following links:

Zoho Inventory: Get Records by ID

Zoho Flow: Embedding App Connections in an invokeURL Task

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