Hi, The required field varies based on the type of the product you are trying to add i.e. If WriteIn then you need to pass the "Product Description" & "Price Per Unit" If Existing Product then "Product Id" & "Default Unit". Also, you need to parse the values of quantity & price per unit to to integer Below are the sample code for Write In & Existing Product- // WriteIn Product var newProduct= {}; newProduct["salesorderid@odata.bind"] = "/salesorders(D6B5E701-A0C9-E711-8127-480FCFF12AC1)"; newProduct.isproductoverridden = true; newProduct.productdescription = "ABC25"; newProduct.priceperunit = Number(parseFloat(25).toFixed(2)); newProduct.quantity = parseInt(25); // For Existing Product var newProduct = {}; newProduct["salesorderid@odata.bind"] = "/salesorders(D6B5E701-A0C9-E711-8127-480FCFF12AC1)"; newProduct.isproductoverridden = false; newProduct["productid@odata.bind"] = "/products(428E15F5-A0C9-E711-8127-480FCFF12AC1)"; newProduct["uomid@odata.bind"] = "/uoms(79F19CBF-07E2-4EF3-9C9E-B913821F553F)"; newProduct.quantity = parseInt(19); newProduct.ispriceoverridden = true; newProduct.priceperunit = Number(parseFloat(19).toFixed(2)); I hope this helps. If my post answers your question, please mark as "Verified"
↧