How can we update the Inline Tax in a Purchase Item using deluge?
Dear All,
I am trying to update a Purchase Order using deluge. I can update all the fields except of the Line Tax.
I would like to put 0% on it using deluge.
I have tried the below but it does not work. What I have to change? Is the problem the field names in the Purchase_Item? I am not sure if the "line_tax" is the correct name. I have also tried as "Tax" but again it did not work
- productDet = ifnull(respMap.get("Product_Details"),"");
- pdlist = List();
- for each eachProd in productDet
- {
- productvalue = eachProd.get("product");
- proid = productvalue.get("id");
- proname = productvalue.get("name");
- mp = Map();
- mp.put("product",{"name":proname,"id":proid});
- mp.put("quantity",ifnull(eachProd.get("quantity"),"0").toLong());
- lineTaxList = List();
- lineTax = Map();
- lineTax.put("percentage",0.00);
- lineTax.put("name","VAT");
- lineTaxList.add(lineTax);
- mp.put("line_tax", lineTaxList); // Add the updated line_tax list
- mp.put("Description","Test");
- pdlist.add(mp);
- }
- paramap = Map();
- paramap.put("Purchase_Items",pdlist);
- data = {"data":{paramap}};
- createResp = invokeurl
- [
- url :"https://www.zohoapis.eu/crm/v7/Purchase_Orders/"+POID
- type :PUT
- parameters:data.toString()
- connection:"crmconnectionnew"
- ];