Real time data at the document

Hope all are fine.

If I need to display data to be real time (live), without need to click on refresh, how I can do this?
For example: let it update the data every 6 seconds. How?


Please elaborate the use-case. Currently, it does show data in real time.

For example, I open new Sales Order. At the same time, other user creates new Customer. Now, when I click on the Customer link field, it will how me the Customer saved just just now as well.

Thank you umair for your kindly reply and help.
I am talking about something else.
If I need to display data (in document or in report), this data is statistical data (for example: total sales amount, total POS amount, … etc), and I need this data to keep updated (always changing without click on refresh) based on the new entered data to the system, how I can obtain this?
@umair, it is like excel sheets, the cells are updating the values if other related cells are changed without need to do refresh. This is what I need but of course for certain thing (I need it mainly to be used for having summary report which will be always opened to keep monitoring the activities without need to keep pressing on refresh to get new updated values). Hope I was able to explain the idea well.



I think it’s doable, but has it’s own operational cost, specially in the cloud instance. It will have to update documents in real-time which could also lead to data loss. It makes more sense in google docs where you have multiple users working on the same doc., but in ERPNext, mostly one person works on one doc. Might be doable in the reports, but till might require expensive real-time data querying. You can post it as a feature suggest for the reports here.

As long as its in the Report view where data manipulation does not happen, I think its achievable. You can perhaps call a setInterval function in the onload of a Report and call refresh function in the setInterval and assign a time limit. Although it comes at a cost too, that even if you move away from report to something else, the function will keep running [ Remedy for this - assign a variable name to the setInterval function and on page leave call the clearInterval(pass_name_here) to close the running process ]. Something similar to this is done in POS too I guess here

BTW, the new ReportView (based on DataTable) already has this feature. It refreshes automatically whenever a new document is created or updated.


Thank you all.
@Zlash65 Yes this is what I need and thank you that you notified me about clearInterval(pass_name_here). But where is the problem if I used setInterval with document if I only need to refresh the data?
You might need to ask me, why to use document and not report? The answer is: maybe because I might need to display the values (which mostly they are 2 or 3 or 4 values) and I need to display them like in document (nothing more).

Thanks a lot @umair and @netchampfaris for the nice and great reply.
But as we talked about DataTable and because still I am working in version 9, so the question is:
The list view will be changed and we will be able to display more columns and scroll right and left using horizontal bar to navigate more columns and play in the grid column width? It is really very important point and it is causing a lot of troubles because of this limitation.


In V10, columns rendered in the list view remains same. However, you will be able to switch to report-like grid view which will render more columns.

Thank you @umair.
And child table will take any benefit from the data table or only the report?
Is there any progress to resolve the list view problem?

You can add more columns in the child table even now

The data table is only for the reports.

Hello @umair
Thank you for your kindly support.

Regarding to rendering the data in the child table and showing more data, which can be achieved by un-check editable grid, I am doing this with custom documents but it is not rendering :frowning: It is working with the already existed documents (like sales invoice) ! What could be the missing?

From the other side: When we can have better list view that enable us to play with the columns width and display more columns and have horizontal scroll bar to navigate more columns. It is really important because it is simplifying the work by having better look on the records and knowing which record need to be manipulated without go inside the record and discover that it is not the right record and then go back and select another record and so on … it is really not practical work.


Datatable seems to be missing filtering if it is for reports. Excited to use it, but thats kind of a mandatory thing. Is it easy to add? If so can you add it or can you post the code to do so?

Hello @joshreeder
Which version you are using?
I am using the below version and I am able to do filtering at the report:

ERPNext: v10.0.23 (master)
Frappe Framework: v10.0.25 (master)

What problem in filtering you are facing?

Please can datatables be implemented for child tables now?