3 Replies Latest reply on Dec 21, 2008 5:50 PM by raybaudi

    Script to reset radio button selections

    satinder

      Title

      Script to reset radio button selections

      Post

      Hi,

      In my database, I have to print selected product records sometimes by manually tagging them to be printed.  I did this by including a To Print? field in my layout.  This field is formatted with 2 radio buttons:  Yes, and Reset.  When I want to print, I select the Yes radio button.  When I want to reset all the selected records to Reset, I find all the To Print records, view the results as a table, and then manually select the Reset radio button for each record. 

       

      I would like to create a script that finds all the records that have been tagged as Yes to print and then automatically clears this Yes flag.

       

      Any suggestions would be appreciated.

       

      Thank you

      Satinder

        • 1. Re: Script to reset radio button selections
          raybaudi
            

          I satinder

           

          it seems to me that you do not need to find all tagged records...

           

          To set that field to "Reset" for ALL your records simply:

           

          Show All Records
          Replace Field Contents [ ToPrint? ; replace with calculated result: "Reset" ]
          Committ Record/Request

          • 2. Re: Script to reset radio button selections
            satinder
              

            Thank you for the suggestion.  I tried something slightly different last night which was to simply clear the Yes field instead of changing it to Reset.  All I really need to do is to clear it; having a Reset option was my way of initially clearing it manually.

             

            I created the script below and it partially works.  It clears only the record that I am currently on, not all of the records.  Could you please guide me on what change I need to make for it the clear the Select To Print value of Yes in all of the records?

             

            Show All Records
            Select All

            Clear [Select;Product Catalog::Select_to_Print]

             

            Thanks.

            Satinder

            • 3. Re: Script to reset radio button selections
              raybaudi
                

              "I created the script below and it partially works"

               

              Yes, your script can act only on the current record.

               

              If you changed that field to only have a value ( Yes ) by using a value list of only a value, the script becomes:

               

              Show All Records
              Replace Field Contents [ Product Catalog::Select_to_Print ; replace with calculated result: "" ]
              Committ Record/Request