Updating Products In a Sales Order
I am trying to using Zoho flow to create an automation to update all products on a sales order with a predefined project_id.
My inputs to the customer function is Sales order ID and Project ID.
My code is this:
- void salesorderupdateprojectstatus(string SalesOrder_ID, string Project_ID)
- {
- info "Sales Order ID " + SalesOrder_ID;
- info "Project Order ID " + Project_ID;
- SalesOrder = zoho.books.getRecordsByID("salesorders","XXXXXXX",SalesOrder_ID,"zohobooksconnection");
- SalesOrderJSON = SalesOrder.toJSONList();
- // info SalesOrderJSON;
- ProductList = SalesOrderJSON.getJSON("salesorder").getJSON("line_items");
- // info ProductList;
- projectmap = Map();
- projectmap.put("project_id",Project_ID);
- lineitemmap = Map();
- lineitemmap.put("line_items",projectmap);
- salesordermap = Map();
- salesordermap.put("salesorder",lineitemmap);
- for each item in ProductList
- {
- SalesOrderUpdate = zoho.books.updateRecord("salesorders","XXXXXXX",SalesOrder_ID,salesordermap,"zohobooksconnection");
- }
- info SalesOrderUpdate;
- }
But this does not seem to update. Any one know why this isnt working?
Thanks for any help
Access your files securely from anywhere
Zoho Developer Community
Deliver unforgettable customer experiences
Deliver unforgettable customer experiences
New to Zoho Marketing Plus?
Everything you need to run your marketing
New to Zoho Marketing Plus?
Everything you need to run your marketing
Zoho Desk Resources
-
Desk Community Learning Series
-
-
-
-
-
-
-
-
-
Zoho TeamInbox Resources
Zoho DataPrep Resources
Zoho CRM Plus Resources
Zoho Books Resources
Zoho Subscriptions Resources
Zoho Projects Resources
Zoho Sprints Resources
Qntrl Resources
Zoho Creator Resources
Zoho Campaigns Resources
Zoho CRM Resources
Zoho Show Resources
Writer Get Started. Write Away!
Writer is a powerful online word processor, designed for collaborative work.