I’m trying to set up a simple accounting system. I want several tables, one for each activity. Following Dmitry’s suggestion I created a master table like so:
+------+------+-----+-------+------------+
| Date | IN | OUT | Descr | Cost center|
+------+------+-----+-------+------------+
Where Cost center
is a reference to a table of cost centers. Then I can create a new page with a table linked to the master, set the filter to only display a single cost center and hide that column, then add a grid widget to display the totals and their difference. This requires quite some work. Duplicating a page to add another table and modify it doesn’t work, while re-doing all the procedure is error prone if some time passed.
There is a Code View at the bottom left. It doesn’t show the widgets. It’s not editable. It has a function _default_Cost_center()
which always returns 2, which is not what I meant. I grepped all files below grist-core
and none of them had that code in it. How is that code used?
Is there a way to programmatically add a new page with widgets as above, just changing name and cost center number? It would be much easier to change a piece of code than clicking around anew. I browsed the API docs, but the only approximately fit thing I found is Modify a workspace, but the example only shows how to rename it. The Grist API help generated locally is much richer, but doesn’t mention widgets.