November 16, 20178 yr Newbies Hi everyone good afternoon!! I’m dueling with FileMaker trying to make the following: I have 3 tables (this is for a game I’m developing): Player (id, name) PlayerStats (id, playerId, statId, value) Stats (id, name) The Player relates to PlayerStats with one to many. The Stats doesn’t relate to anything as I’m using it more like a list source for the “statId” field (or should I make a relation there?) my question is how can I make it so that when I add a new player record it automatically creates all the PlayerStats entries (on for each entry in the Stats table for that Player) and when deleting a record from Stats table all the PlayerStats that refer to that Stat get removed also. also I don’t know if this is the right forum to post this... but I don’t know where it should go... and I also don’t know if this was asked before as I don’t know what to search for in order to do this. :/ 😐 Edited November 16, 20178 yr by xykudyax
November 16, 20178 yr You will have to script record creation. You can either place a portal on the layout and go to that object or you can go to the native layout and create a records there. I recommend learning about ERDs. You can use Google, there are tons of examples out there.
November 16, 20178 yr Here's a demo. However, there is no check to see if there already is a record with the stat for this player (that is, no check for duplicates). Also, what happens if you add a stat? You'd need a script to add that stat to the players_stats table for each player. xydudyax.fmp12
November 17, 20178 yr Author Newbies Thank you so much for your help I'll give it a look! 13 hours ago, bcooney said: Also, what happens if you add a stat? You'd need a script to add that stat to the players_stats table for each player. That's exactly that!! It will need to be added automatically to every player_stats of each player!
Create an account or sign in to comment