cooper collier 4/18/2025 2:17:39 PM Using the javascript is not "hacky" that is why they have it so you can perform some tasks that are beyond the ability of the RAS. If I was making a system using basic MYSQL, I would be using JavaScript and PHP to do exactly the same things.
Anyway, I just tested my idea and it works fine. You may or may not like this method.
Sorry the following is rushed!! I will make a sample database in the next couple days for anyone interested. I can show it in detail at a later date, but in short.
We make a table call it !default child!, you then have all the columns that would be in the actual child table. (you can make this table simply by copying the child table and removing the reference column to the main table.) Now you make a column called number.
So now you have TABLE!Default Child! with [number] [all the other columns] and no references.
Next you populate it with as many records as the maximum child records you would have. Just use a spreadsheet to make them fast and increment the number by 1.
Now comes the tricky part
I use the user properties for this next step. I make a hidden column for number records to copy in users Back to your main table. Make a refernce to users, keep it hidden. Make a number column for [number of records to copy]
make a many - many reference to the Default Child. Make it with no views
then make a recordset for the many many relation, call it records to copy, use a custom filter. [number]<=User[test number to copy]
Now everything is ready!!
Create a Button. set the button to ask for the [number of records to copy] Assign User() to User Property
make an action to copy the number to copy to the User Property table Number to copy. (this makes the recordset to the defaults to have only the number of records needed)
make another action to create record source is the record set, target is the child table. Assign each default column to the matching child table column Assign Parentkey() to the Reference to the main table.
AFTER ALL THAT CONFUSING MESS IT WILL WORK.
I do not have the time right now. I will try tomorrow morning to make a video and show everyone. and make a sample database for teamdesk to post.
|