如何连接Zoho Flow自定义洪水功能?我一直遇到错误57(未经授权的访问)
我正在研究一个涉及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;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用内置的洪水集成功能时,您需要使用连接链接名称进行身份验证。有关更多详细信息,请参阅以下链接:
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