Building a test layout for learning purposes.

Discussion created by pedantic on Jan 31, 2013

Hello everyone.


I have since joining this forum done plenty with code, but I have hardly ever worked with the layouts themselves, so I decided to remedy that deficiency in my resume, even if it meant building a layout that was just for learning.


Here's the situation. I have three tables: Users, Coins and Coinlist.


The first table, Users, has user information including a unique numeric serial ID which I am using to relate it to the second table.


The second table, called Coins, has information on coins owned by the user (for example, gold coins, silver coins, etc.) and the number of each. It also has a unique serial ID. It is related to the first table through the unique ID in Users. A record may look like this:


ID (Unique ID)

CoinOwner (The key from the Users table)

CoinValueRec (The key pointing to the record for this particular coin in the CoinList table)

CoinCount (The actual number of this particular coin owned by the related user)

CoinsCount (A calculated field--the number of coins posted to this record times the coin value in the related record in the CoinList table)


The third table has the actual name of the coin and the value of each coin (the values are made up--this was just for experimenting). For example the record for a gold coin looks like this (assume each line is a field)


CoinID (Unique id that points back to the Coins table)

gold coin (The type of coin)

$1.33 (The value of a single coin)


The CoinID field relates back to the unique id in the Coins table.


Finally I have the layout that is supposed to show all of this.


The layout shows the user information without a problem, one record at a time (as designed).


I added a portal onto the layout to display the information from the Coins table, and set a filter so that only the right coin information would show up (this works like a charm). I did this by adding a filter to the portal that told it to show only those records whose User ID = CoinOwner and where CoinValueRec = CoinRec. That portal works as designed. As I cycle through the users, the number and value of the coins changes as desired.


However when I attempted to put in a second portal that shows only the CoinsCount (a calculated field equal to the CoinCount times the value of a single coin), that portal shows only one value for the Gold coins. Looking at the raw tables, the calculated values are there, but only one record appears in the portal.


I apply the same filter to the second portal that does not work, as I do to the first portal, which does work.


Now this may be waaay to complex for a forum message, and if so, then I apologize. My question is simply this: How do I get the second portal to show all values associated with the coins associated with the single user?


I have attached the .FP7 file for any who wish to dl and look at it. The data in it is all made up so do not worry about any privacy issues.