Reputation: 1
This is a database for logging shots on a film set.
I want to put an "add another take" button in each shot record which when pressed, it adds an additional line of fields to the record.
The reason I don't want to just add another record for every take is because I want to have only one record per shot and I need to be able to view all the takes for one shot at the same time on the same screen in a row.
I've searched all the helps and manuals I could find and haven't figured out how to do this. Help :) !
Upvotes: 0
Views: 935
Reputation: 116982
It's not possible to change the schema programmatically. What you really want to do here is use two tables, Shots and Takes, with a one-to-many relationship between them. Then use a portal to Takes, placed on a layout of Shots, in order to "add an additional line of fields to the [shot] record".
Here's an example of a script to create the necessary sub-takes.
Set Variable [ $takeID; Value:Takes::TakeID ]
Set Variable [ $cameras; Value:Takes::Cameras ]
#
Go to Layout [ “SubTakes” (SubTakes) ]
Loop
Set Variable [ $i; Value:$i + 1 ]
Exit Loop If [ $i > ValueCount ( $cameras ) ]
New Record/Request
Set Field [ SubTakes::TakeID; $takeID ]
Set Field [ SubTakes::Camera; GetValue ( $cameras ; $i ) ]
End Loop
#
Go to Layout [ original layout ]
Upvotes: 3