John Chamberlain Posted July 20, 2018 Posted July 20, 2018 I have a couple of scripts; one deletes redundant records, and the other adds new records under certain cirumstances. Is there a scripting way to show how many records were added (or deleted), when the script finishes?
Lee Smith Posted July 21, 2018 Posted July 21, 2018 Hi John, You might get a quicker response if you attached a mockup of the file, a copy of your real file, or copies of the scripts. Lee
bcooney Posted July 21, 2018 Posted July 21, 2018 Does a user run this script or is this done by a scheduled script? If a user does this script, simply use a counter and show the counter at the end of the script with a custom dialog. A better description of the use case would be helpful. Lots of red flags. 1
John Chamberlain Posted July 22, 2018 Author Posted July 22, 2018 The file runs an opening script that scans a list of about 10,00 records and looks for duplicate records, then deletes them. There is a second script that is called from a script that is activated by a button push; this script adds several records to a different list. I wanted to know if there was a way to insert a step at the end of each of these scripts that would show how many records were deleted or added. I hesitate to send a copy of my file, as it is in rough shape, and needs much cleanup.
bcooney Posted July 22, 2018 Posted July 22, 2018 Why do you need this? It's really quite unusual. How do you know you have duplicates? Why do you have duplicates? You capture the found count before and after this routine and show user the diff. when you add records, don't you know how many you're adding?
John Chamberlain Posted July 22, 2018 Author Posted July 22, 2018 How do you know you have duplicates? Why do you have duplicates? Records are created by inexperienced users, who sometimes forget and enter records twice. Moreover, records are created by placing checkmarks on a form (sometimes as many as 50 on a single form. The opening script looks at all records and deletes those that are double entered. Showing a data entry person that duplicates have been deleted makes them aware of the possibility that they may be doing something wrong. You capture the found count before and after this routine and show user the diff. This will work for me...thanks. when you add records, don't you know how many you're adding? The script already displays a message stating that a batch of records has been added (from the form mentioned above). What I would like to show the data entry person is how many records were added. This might catch her attention if the number was too low or too high. Thanks for your help.
Lee Smith Posted July 22, 2018 Posted July 22, 2018 Why not use the Validation Options for the fields? https://fmhelp.filemaker.com/help/16/fmp/en/#page/FMP_Help%2Ffield-validation.html This session by Matt Petrowsky shows how to set validations. https://www.youtube.com/watch?v=xZ-ZK3yCp5g&feature=em-lss
LaRetta Posted July 23, 2018 Posted July 23, 2018 (edited) 9 hours ago, John Chamberlain said: The script already displays a message stating that a batch of records has been added (from the form mentioned above). Hi John, I am unsure of your batch process script so you'll have to adjust this to fit your needs. If [ batch test which decides a new record should be created ... ] New Record/Request Set Variable [ $count = $count + 1 ] End If ... then display $count in your Custom Dialog. On 7/21/2018 at 5:13 PM, John Chamberlain said: I hesitate to send a copy of my file... We certainly understand that, John! 😃 But as Barbara points out, it is difficult to provide a safe answer when we can't see your script. In truth, depending upon your script, I would put this within a single loop but I couldn't suggest it because I don't know your batch script. Another possibility is to begin on an empty record set ( for adding records ) and then your found count after you've added your multiple new records is the correct answer. You can do this easily by: Go To Record/Request/Page [ First ] Omit Multiple [ dialog: off, Specify: Get ( FoundCount ) ] Then begin adding your records. And if you need to preserve your prior found set, do this in a new window and then just close it. Edited July 23, 2018 by LaRetta
Recommended Posts
This topic is 2315 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