Updating Products In a Sales Order

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:
  1. void salesorderupdateprojectstatus(string SalesOrder_ID, string Project_ID)
  2. {
  3. info "Sales Order ID " + SalesOrder_ID;
  4. info "Project Order ID " + Project_ID;
  5. SalesOrder = zoho.books.getRecordsByID("salesorders","XXXXXXX",SalesOrder_ID,"zohobooksconnection");
  6. SalesOrderJSON = SalesOrder.toJSONList();
  7. // info SalesOrderJSON;
  8. ProductList = SalesOrderJSON.getJSON("salesorder").getJSON("line_items");
  9. // info ProductList;
  10. projectmap = Map();
  11. projectmap.put("project_id",Project_ID);
  12. lineitemmap = Map();
  13. lineitemmap.put("line_items",projectmap);
  14. salesordermap = Map();
  15. salesordermap.put("salesorder",lineitemmap);
  16. for each  item in ProductList
  17. {
  18. SalesOrderUpdate = zoho.books.updateRecord("salesorders","XXXXXXX",SalesOrder_ID,salesordermap,"zohobooksconnection");
  19. }
  20. info SalesOrderUpdate;
  21. }
But this does not seem to update. Any one know why this isnt working?

Thanks for any help
    Zoho Desk Resources

    • Desk Community Learning Series


    • Digest


    • Functions


    • Meetups


    • Kbase


    • Resources


    • Glossary


    • Desk Marketplace


    • MVP Corner


    • Word of the Day


      Zoho CRM Plus Resources

        Zoho Books Resources


          Zoho Subscriptions Resources

            Zoho Projects Resources


              Zoho Sprints Resources


                Zoho Orchestly Resources


                  Zoho Creator Resources


                    Zoho WorkDrive Resources



                      Zoho Campaigns Resources

                        Zoho CRM Resources

                        • CRM Community Learning Series

                          CRM Community Learning Series


                        • Tips

                          Tips

                        • Functions

                          Functions

                        • Meetups

                          Meetups

                        • Kbase

                          Kbase

                        • Resources

                          Resources

                        • Digest

                          Digest

                        • CRM Marketplace

                          CRM Marketplace

                        • MVP Corner

                          MVP Corner




                          Zoho Writer Writer

                          Get Started. Write Away!

                          Writer is a powerful online word processor, designed for collaborative work.

                            Zoho CRM コンテンツ




                              ご検討中の方