Field Not Updating in FSM Script - Service and Parts module.

Field Not Updating in FSM Script - Service and Parts module.

Dear Team,

I am reaching out regarding a script I have implemented in Zoho FSM to automate the calculation of the End of Service date based on the End of Sale date in the Service and Parts module.

Overview of the script:

  • Fetches the End_of_Sale__C and End_of_Service__C fields from the Service and Parts record.

  • Checks if the End_of_Sale__C date is valid.

  • Calculates a new End_of_Service__C date by adding 5 years to the End of Sale date.

  • Updates the End_of_Service__C field only if it is empty or different from the calculated date.

Despite executing successfully, the script does not update the End_of_Service__C field as expected. I would greatly appreciate guidance on why the update might not be taking effect and any recommendations to ensure the field updates correctly.

Script:

// Fetch fields from input var_End_of_Sale = service_and_part.get("End_of_Sale__C"); // Check if End_of_Sale date is valid if (var_End_of_Sale != null && var_End_of_Sale.isDate()) { // Calculate End of Service = End of Sale + 5 years var_New_End_of_Service = var_End_of_Sale.addYear(5); var_New_End_of_Service_Str = var_New_End_of_Service.toString("yyyy-MM-dd"); var_Update_Map = Map(); var_Update_Map.put("End_of_Service__C", var_New_End_of_Service_Str); var_Record_Id = service_and_part.get("id"); var_Update_Response = zoho.fsm.updateRecord("Service_And_Parts", var_Record_Id.toLong(), var_Update_Map); }

Thank you for your assistance.

Best regards,
Chethiya

    Access your files securely from anywhere







                            Zoho Developer Community





                                                  Use cases

                                                  Make the most of Zoho Desk with the use cases.

                                                   
                                                    

                                                  eBooks

                                                  Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho Desk.

                                                   
                                                    

                                                  Videos

                                                  Watch comprehensive videos on features and other important topics that will help you master Zoho Desk.

                                                   
                                                    

                                                  Webinar

                                                  Sign up for our webinars and learn the Zoho Desk basics, from customization to automation and more

                                                   
                                                    
                                                  • Desk Community Learning Series


                                                  • Meetups


                                                  • Ask the Experts


                                                  • Kbase


                                                  • Resources


                                                  • Glossary


                                                  • Desk Marketplace


                                                  • MVP Corner






                                                            Manage your brands on social media



                                                                  Zoho TeamInbox Resources



                                                                      Zoho CRM Plus Resources

                                                                        Zoho Books Resources


                                                                          Zoho Subscriptions Resources

                                                                            Zoho Projects Resources


                                                                              Zoho Sprints Resources


                                                                                Qntrl Resources


                                                                                  Zoho Creator 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


                                                                                            Zoho Show Resources


                                                                                              Zoho Writer Writer

                                                                                              Get Started. Write Away!

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

                                                                                                Zoho CRM コンテンツ








                                                                                                  Nederlandse Hulpbronnen


                                                                                                      ご検討中の方