February 6, 201213 yr I know it might be easy, but I'm stuck. I need a join table to be populated automatically. Lets say this tables Persons: ID–Name–Code Animals: ID–Name–Code Materials: ID–Name–Code ALLTogether (JOIN): ID–Data–Code What I’d like to accomplish is: Every time I create a new record in one of the main tables, an automatic related record should be created in the related one with some data from the main table and its code. And so if I delete the record (its related record should disappear). I.e.: Persons: ID: 1, Name: John, || ID: 2, Name: Mary, || Code: (global) PRS. Animals: ID: 1, Name: Puppy, || Code: (global) ANI. Materials: ID: 1, Name: Wood, || Code: (global) MAT. Result: ALLTogether: ID: 1, Data: John, Code: PRS ID: 2, Data: Puppy, Code: ANI ID: 3, Data: Wood, Code: MAT ID: 4, Data: Mary, Code: PRS Thanks for your help.
February 6, 201213 yr You can use a portal to automatically create a related record through a relationship by entering it into the portal but that doesn't allow for automatically populating any of the fields other than the foriegn key field. Other than that you would need to script your record creation in the Parent table somewhat like this. From a button on the parent layout Psudo script New Record Request Set Variable ( $id; Parent::ID ) Set Variable ( Set the info you want in the new record from the parent into variables) Goto ( a layout based on the child table ) New Record Request Set Field ( Child::ID ; $id ) <-- Set the foriegn key Parent ID field in the child equal to the primary key from the parent thus establishing the relationship. Set Field ( What ever data from your variables you wanted in this new record ) Goto Original Layout
February 6, 201213 yr Author I had the idea that had to be thought a script, but hoped it could be done automatically. I post a sample file, with the disappearing button trick implemented. I hope it can help others and if it can be simplified or improved (it's a newbie sample file so don't expect much ;-)) all help will be appreciated. Thank you for your help. The sample file is in spanish but I think perfectly understandable. Test.zip
Create an account or sign in to comment