Can a Listview on Screen C show both databases from Screen A and Screen B?

Dear all,

I am new to AI trying on a personal stocks translations record App, Screen A is stocks_buying information while Screen B is stocks_selling information. And Screen C intends to use a Listview to show all translations included.

The difficulty I met now is Screen C (screen 5) can only show the data input on Screen A (screen 2) but not those from Screen B (screen sellingstock), I used the same TinyDB name, Listview name and tag of DB among all three screens already.

Anyone can kindly help? Thanks a lot.

LL

Relating parts of code are attached for reference:



image
image

I am going to assume in my answer that both your purchases and sales Screens are meant to operate on the same list from TinyDB. If that assumption is wrong, stop here and tell me.

Otherwise, follow this advice when you are using multiple Screens:
Global variables are your enemy, and not helpful compared to TinyDB get and store blocks.

Here is an example of how to maintain lists in TinyDb without any use of global variables, from this sample app : https://docs.google.com/document/d/1GLQJY9q3b8KsEAcfzPEcA-j0zWgyRjTI2Pa792znsBI/edit?usp=sharing

These procedures are used to keep lists of players in different teams, by name, in a shared TinyDB …

addTeam addTeamPlayer Capture Adding team members - Dwarves Capture Teams dropTeamPlayer getTeam lpkAddTeamPlayer_AfterPicking lpkAddTeamPlayer_BeforePicking lpkTeam_AfterPicking refreshTeamPlayers
refreshTeamPlayers

Pay close attention to the two procedures drop team player and add team player.
The list maintenance is done to a temporary local list variable that exists just for the moment between arrival of the team player list from TinyDB and storage of the newly updated player list back into TinyDB. No global variable was used for long term storage of team players. No need to worry about having to access another Screen’s global variables (impossible in AI2.)

Dear ABG,

Thanks for your kind reply so much. Yeah, what I hope is all data operate on the same list from TinyDB. Let me take some time to see whether I can understand the sample you kindly offered and will get back to share if can solve it, many thanks again.

LL