madman411 Posted January 31, 2013 Posted January 31, 2013 Hey all. Wanting to write a script that removes all related records displayed in a portal row. Currently I have several scripts a user can run that will create a certain number of related records (in this case, 5 days): Freeze Window Set Variable [$weekid; Value:${Weeks and Data}::week id] Set Field [Weeks and Data::global_days_count; 5] Go to Layout ["Hours" (Hours")] Loop Exit Loop If [${Weeks and Data}::global_days_count = 0] New Record/Request Set Field [Hours::week id; $weekid] Set Field [Weeks and Data::global_days_count; ${Weeks and Data}::global_days_count - 1] End Loop Go to Layout ["Weeks and Data" (Week and Data)] Now, the user can create as many "days" as he/she wants. I want this script to remove all the related records (days) no matter how many have been created. I have written a script that potentially just reverses the above, but I'm concerned that it *may* remove all the records within the Hours table, and at this point I would rather get a pro's opinion when so much data is at steak. Thank you all for your help.
Rick Whitelaw Posted January 31, 2013 Posted January 31, 2013 What are you trying to accomplish in real world terms? The point?
madman411 Posted January 31, 2013 Author Posted January 31, 2013 What are you trying to accomplish in real world terms? The point? hmm. i'm unsure what you mean by "real world terms" - i thought this forum was a place to come when a layman is seeking help. i thought i laid out my intentions pretty well in the OP. the database is merely a small project i've been working on developing since i started trying to learn filemaker. the application tracks hours worked and gives an estimated paycheck amount. sometimes i try to look ahead at what i may earn by entering supposedly worked hours. instead of clearing every field, i'd rather just delete the records.
dansmith65 Posted January 31, 2013 Posted January 31, 2013 Try something like this... If[ Count ( RelatedTable::id ) // make sure related records exist] Go To Related Records[ RelatedTable ; RelatedTablesLayout ] Delete All Records Go to Layout[Original] EndIf 1
Rick Whitelaw Posted January 31, 2013 Posted January 31, 2013 Madman411, Thanks. I didn't understand your intent in the OP. your reply spells it out.
Recommended Posts
This topic is 4313 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now