3 Replies Latest reply on Jan 24, 2010 8:17 AM by HugoLidia

    Button to toggle field



      Button to toggle field


      I am doing an attendance tracking program and it calls for a list of students on which to quickly check a person as Present or Absent. The way I desire to do it is to have a field that contains either an A or a P. With one click I want to toggle it between the two. Here is what I have so far:


      I made a text field called Attendance. In a list layout, I included that field and made it a button with an If statement that does this properly. The field works great, except it changes all the records because they are a found set (a pop-up menu at the top allows you to select the specific class).


      I then tried a portal using an "x" join. It works, but only on the first shown record. If there is only one record, it doesn't work at all.


      Can someone give me some hints at what I am doing wrong?

      (If someone wanted to suggest a neat interface trick to make it quicker to enter attendance on each student, I am all ears!)


      Thanks for the help,


        • 1. Re: Button to toggle field

          make two textfields


          dummy_a, global, = "A"

          dummy_p, global, = "P"


          and them make two joins from your table, to your table itself.


          from field dummy_a to person_is_present (or however you have named the field), = (but not cross)

          name this instance of your table xyz_is_absent


          from field dummy_p to person_is_present, =

          name this instance xyz_is_present


          ét le voilá *1), the work is done. 


          greetings from germany 




          *1) to Hugo: i hope you can read french. 


          • 2. Re: Button to toggle field

            whardy7 wrote:

            The field works great, except it changes all the records because they are a found set

            I would suspect that it changes all records because the field is global (or that you are using Replace Field Contents[] in your script).  If you are using script similar to:


            Set Field [ Attendance ; Case ( Attendance = "P" ; "A" ; "P" )


            ... and if Attendance is not global (and is text) then it should properly  toggle.  You might wish to set up the Attendance field with default entry of P (since hopefully most students attend class) and then you'll only have to go through the list and toggle those you have identified as Absent. :smileyhappy:


            UPDATE: Oh, and you should disallow entry to the field in Browse mode (see field behavior).

            • 3. Re: Button to toggle field
                 Yes thanks Kapitaen!