I have a question about the customization of a product detail item.
I created an item (API name: field) in the item details and called the item details with a custom function, but the above item (API name: field) could not be called.
Please let me know how to call the item created in the product details item.
《Custom Functions》
resp = zoho.crm.getRecordById("Sales_Orders",Sales_Orderid);
lineitems = ifnull(resp.get("Product_Details"),"");
maeukesubtotal = 0.0;
normalsubtotal = 0.0;
for each item in lineitems
{
ProductCode = ifnull(item.get("product").get("Product_Code"),"");
info ProductCode;
info item;
if(ProductCode == "MP01" || ProductCode == "MP02")
{
maeukesubtotal = maeukesubtotal + item.get("field");
info maeukesubtotal;
}
else
{
normalsubtotal = normalsubtotal + item.get("field");
info normalsubtotal;
}
}
mp = Map();
mp.put("maeuke_subtotal",maeukesubtotal);
mp.put("normal_subtotal",normalsubtotal);
update = zoho.crm.updateRecord("Sales_Orders",Sales_Orderid,mp);
《message in the console》
情報
R800
{"product":{"Product_Code":"R800","Currency":"JPY","name":"RIKCAD10","id":"3745067000002656873"},"quantity":1,"Discount":0,"total_after_discount":1080000,"net_total":1188000,"book":null,"Tax":108000,"list_price":1080000,"unit_price":1080000,"quantity_in_stock":-71,"total":1080000,"id":"3745067000004716267","product_description":null,"line_tax":[{"percentage":10,"name":"消費税","id":"3745067000002625888","value":108000}]}
関数を実行できませんでした
Null value occurred while performing Addition operation. Line Number:19