laguna92651 Posted December 27, 2012 Posted December 27, 2012 I want to do a Delete All Selected records script by ssetting a Select checkbo, which I think should be easy enough, but before I do the Find and Delete I want to be sure there is a Select field selected in at least one record of the displayed view, if not I want to display a message "Please select records to delete", Want would be the logic to go through the displayed list to determine that at least one record is selected? Thanks
doughemi Posted December 27, 2012 Posted December 27, 2012 Make the Select checkbox work from a value list of just 1. Create a calculated field isTrue = 1. Create a new TO of your table and relate it by YourTable:isTrue = YourTableNewTO::select. Script for your delete button: If[count(YourTableNewTO::select) = 0] Show Custom Dialog["Please specify items to delete"] Exit Script Else Go to Related Records[From table: YourTableNewTO; Using layout <current layout>] Delete all records[] End if
comment Posted December 27, 2012 Posted December 27, 2012 before I do the Find and Delete I want to be sure there is a Select field selected in at least one record of the displayed view Assuming that "at least one record of the displayed view" means "at least one record of the current found set", you can use a summary field to count (or, if it's a Boolean field, to sum) the Select field. The other option is to turn error capture on, do the find (or constrain found set?) first, then see if you have any records in the found set. You could do this in a new window, if you want the ability to return to the original found set. --- Note also that marking records can be problematic in a multi-user scenario.
laguna92651 Posted December 27, 2012 Author Posted December 27, 2012 Would the summary field be in the same table as the found set, not quite sure how to implement, get the general idea?
comment Posted December 27, 2012 Posted December 27, 2012 Would the summary field be in the same table as the found set Yes.
Recommended Posts
This topic is 4409 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