W-Systems joins SugarCRM! Read Blog

Auto-Save a Record After Timeout

by Eric Wikman on October 14, 2009

4 minute read

One of our clients has a module that has many fields of data on it and they require that form to be automatically saved after a period of time.

There are several ways that we can accomplish this goal but we wanted to tread lightly and add only a minimal amount of code and not alter any of the existing logic of SugarCRM.  What we decided to do was to use a JavaScript solution that is 100% upgrade safe.

When a user is on the edit view for the module a timer is constantly running.  It is a 4 minute countdown timer.  If the user has any activity, like they click anywhere on the page or they hit any key on the keyboard, then the timer is reset back to 4 minutes and begins counting down again.  If 4 minutes elapse without them having any activity then a big bold warning message appears to notify them that the page will be saved if there is no activity within a minute.  If the user does anything in that minute then the timer resets to 4 minutes and the process starts over, but if they do not have any activity during that last minute then the page will be submitted and then the same record is reopened in edit view once again.

The warning message will always appear in the top right hand of the screen (regardless of where the user is scrolled to on the page) so it is easy to see.  The main drawback is that when the page reloads in edit view the cursor will not necessarily be in the same place it was before it was saved, but after such a long timeout there is a good chance that the user is not actually sitting at the keyboard, and the main goal is to be sure that the edits they have made are saved.  Since no logic was altered of the core code of Sugar we can be sure that we are not opening up any backdoors to edit fields that a user doesn't have access to and we maintain preexisting logic like required fields that must be filled out to actually save the form. This is what the warning message looks like:

Warning message

Contact us if you're interested in us implementing an auto-save on your instance of SugarCRM.

About SugarCRM

Sugar’s robust suite of customer experience solutions is changing the game for organizations everywhere. At the heart of Sugar's fully integrated platform is a simple and consistent experience — one that’s tailored to each user’s unique needs and ways of working across any device. It’s how two million users are already closing deals faster and creating customers for life, without spending countless hours digging for data.

Learn More About SugarCRM

About W-Systems

W-Systems delivers sales and marketing solutions on a foundation of CRM to help customer-facing teams increase revenue and solve business problems. With over two decades of industry experience, we help organize information, create efficient processes and measure results.

W-Systems provides solutions around CRM including Marketing, Document Automation, Business Intelligence, Communications, and Cloud Computing. We are Certified Partners of top vendors including SugarCRM, DocuSign, AWSAct-On, GoldMine, and Amazon QuickSight.

Contact Us