Hello,
I need to implement real-time save data like Google Docs or something similar. I will explain in details, multiple users access the same record/data and let say there are 2 users (User1 & User2). When User1 & User2 accessing the same data in the same time, and one of them editing the field, they can see live record changing. The data must be in input-field and text-area.
There is no save button, so I did the autosave by using onChange/onKeyup every time user type something on the field. After that, I use javascript to always refresh the aggregate but not working. I also think this is not the best way. Other than that, I try to search same topic in the forum and mostly related to chat/notification (2 way, sender & receiver).
I hope someone can share suggestion, opinion and guide me the right way to implement this.
Thank you in advance
Hi @Zulfitri Abd Hamid ,In reactive you don't need to refresh aggregate with JS code, updated data will automatically display on the screen.and for auto save, you are applying the correct idea, with the save on change action data will be saved.Did you check DB, Are the records getting updated there?If not then there might be some issue in your save action.I am assuming you don't need any previously changed data(log data). You just want to save a single record and every time any change occurs you are updating the same record.Could you please share the OML for more details?Regards
Hi @Anubhav Rai,
Thank you for reply. Yes, I did use 'refresh data/aggregate', it is showing in the same page (current tab), but it is not reflecting/refreshing anything on the field on the other page (new tab). I also checked on the db, the data updating correctly.
Just to mention possible scenario. For example, 2 browsers open side by side and (User1 and User2) accessing the same data. While User1 editing a field (updating data), User2 who access at the same field in the same time can see the data in the field is changing (if not real time, at least data is refresh to the latest one without refreshing the page).
Sorry currently I did in the company's dev environment (P&C). Will replicate on my personal env later. Thank you
Which component are you using for inserting data?Is it a normal form or a data grid?
Yes it is just normal method. Get current ID and current data, assigning the variables and save to the db.
You can use JS on the screen level which will refresh the page on the interval of defined time. In the below example, the page will refresh after every 30 seconds.
setTimeout('history.go(0);', 30000);