Function to change status of shipment after 3 days

Function to change status of shipment after 3 days

Hello!

I am trying to make a function that through a workflow, changes the status of the shipment to "delivered" after 3 days. The 3 days time is made with the workflow, but the update function is not working. When I try to debug it always give me this error: 
Check and update the code in line 13 as there is a Exception : Value is empty and 'getJSON' function cannot be applied

This is the code. Can someone tell me what I am doing wrong? 


  1. salesorderID = salesorder.get("salesorder_id");
  2. organizationID = organization.get("organization_id");
  3. authtoken = "02bxxx";
  4. response = zoho.inventory.getRecordsByID("SalesOrders",organizationID,salesorderID);
  5. listaPaquetes = response.getJSON("salesorder").getJSON("packages").toJSONList();
  6. for each  paquete in listaPaquetes
  7. {
  8. packid = response.getJSON("salesorder").getJSON("packages").getJSON("package_id");
  9. if(!paquete.getJSON("status").isempty())
  10. {
  11. estadoPaquete = paquete.getJSON("status");
  12. }
  13. if(estadoPaquete = "not_shipped")
  14. {
  15. item = Map();
  16. item.put("status","delivered");
  17. info item;
  18. response = zoho.inventory.updateRecord("Packages","organizationID","packid",item);
  19. info response;
  20. }
  21. // info item;
  22. }

    Access your files securely from anywhere

        Zoho Developer Community




                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation


                                              Manage your brands on social media



                                                    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

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • Functions

                                                                            Functions

                                                                          • Meetups

                                                                            Meetups

                                                                          • Kbase

                                                                            Kbase

                                                                          • Resources

                                                                            Resources

                                                                          • Digest

                                                                            Digest

                                                                          • CRM Marketplace

                                                                            CRM Marketplace

                                                                          • MVP Corner

                                                                            MVP Corner





                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now