10 Replies Latest reply on Mar 6, 2014 10:08 PM by philmodjunk

    Clear

    johnw54

      Title

      Clear

      Post

           I have a checkbox on a layout that I am trying to clear.  The checkbox is used when a user wants to select a record to send in an email. I'm using Replace Field Contents (no dialog;Styles::Catalog; 0)  It is a number field.  It appears to clear the checkbox fine. In data viewer the field is changed to 0. However when i press on the send email button the item shows up as if it was never cleared.  Not sure how to fix this.

        • 1. Re: Clear
          philmodjunk

               Why would the check box show up at all in any form when you "press on the send email button"? Is this a button on your layout? Does it perform a script? If so, what does that script do?

               Replace Field Contents does not appear to be the correct option unless you intend to modify the field of every record in your found set. There is both a Script step named "clear" and a script step named Set Field that can clear a field for just the current record.

               And I would suggest using an empty string "" to clear your check box instead of putting a value in it ( 0 ) that is not part of your field's current value list.

          • 2. Re: Clear
            johnw54

                 I'm sorry I didn't explain the scenario well. I have 1 layout in list view that shows 100 records which includes an image and a checkbox.  There is also a button in the header used for sending an email containing the images of the items that the user selected and a button for clearing all the checkboxes. You can scroll down the list and check as many boxes as you send by email. 

                 When the user first opens the form and presses on the clear button the checkboxes are all clear.  However, if you press on the email button the last image from the previous email still shows up as if it is still selected.  It seems that there should be nothing there. 

                 My clear catalog script seems to work fine.  Then I run a script that finds and sorts the records chosen with the checkboxes. Then I run a script that sets the $path, save records as a pdf and finally send mail.   

                 Also on the Mac is there a way to copy and paste a script into the forum posting box?

            • 3. Re: Clear
              philmodjunk

                   To post a script to the forum:

                     
              1.           You can upload a screen shot of your script by using the Upload an Image controls located just below Post a New Answer.
              2.      
              3.           You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF to your clipboard for pasting here. (with this approach, you can get multiple script steps on the same line, please edit the pasted text by inserting some returns to separate those steps.)
              4.      
              5.           If You have FileMaker Advanced, you can generate a database design report and copy the script as text from there.
              6.      
              7.           If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional and easier to read format.
              • 4. Re: Clear
                johnw54

                     I'm sorry I didn't explain the scenario well. I have 1 layout in list view that shows 100 records which includes an image and a checkbox.  There is also a button in the header used for sending an email containing the images of the items that the user selected and a button for clearing all the checkboxes. You can scroll down the list and check as many boxes as you send by email. 

                     When the user first opens the form and presses on the clear button the checkboxes are all clear.  However, if you press on the email button the last image from the previous email still shows up as if it is still selected.  It seems that there should be nothing there. 

                     My clear catalog script seems to work fine.  Then I run a script that finds and sorts the records chosen with the checkboxes.  Then I run a script that sets the $path, save records as a pdf and finally send mail.

                • 5. Re: Clear
                  philmodjunk

                       It would seem the issue lies with one of your scripts. If you post a copy, others can take a look at it/them to see if they can spot the reason why this is happening. Without that information, there's no real way to suggest a possible answer as far as I can see.

                  • 6. Re: Clear
                    johnw54

                         Here are the scripts involved.

                    • 7. Re: Clear
                      johnw54
                      /files/4d1aa66ca7/Clear_Catalog.jpg 445x233
                      • 8. Re: Clear
                        johnw54
                        /files/050ccc7c57/Send_Style_Catalog_by_Email.jpg 458x259
                        • 9. Re: Clear
                          johnw54
                          /files/922650e12f/Show_Style_Catalog_for_Script.jpg 402x196
                          • 10. Re: Clear
                            philmodjunk

                                 Sorry, but I can see no obvious reasons for this in your scripts.