Adding Subform data to Books Purchase Order Subform using API
Hello,
I am trying to add creator forms subforms data to Books purchase Orders Subform but i am not getting any exact format as of how to map the subform data.
This is the code i tried
- mapp = Map();
- mapp.put("vendor_id","177093000000077066");
- mapp.put("purchaseorder_number",input.PO_No);
- mapp.put("date",input.PO_Date);
- for each rec in Product_Details
- {
- mapp.put("line_items",[{"name",rec.Item.Product_Name}]);
- mapp.put("line_items",[{"quantity",rec.Quantity}]);
- mapp.put("line_items",[{"rate",rec.Rate}]);
- mapp.put("line_items",[{"tax_treatment_code","uae_same_tax_group"}]);
- }
- dataa = Map();
- dataa.put("JSONString",mapp);
- head = Map();
- fet_Api = API_Key[ID == 34396000000988943];
- head.put("Authorization","Zoho-oauthtoken "+fet_Api.Access_Token);
- addRecords = invokeurl
- [
- url :"https://books.zoho.in/api/v3/purchaseorders?organization_id=60002xxxx"
- type :POST
- parameters:dataa
- headers:head
- ];
- info addRecords;
This is throwing me the error of Invalid data provided. Please help me its urgent.