3 Replies Latest reply on Jul 28, 2015 12:07 AM by raybaudi

    Choose All Values in a check-box set for Report

    happy4u*

      Good day,

       

      I am creating an excel report where I would like to see all activities for employees during a specific period of time.

       

      I have a field called Employees in a drop-down list in which the present report I have allow one employee at a time to be chosen ,thus,it  reflects the activities per employee (please see script below for this):

       

       

      However I would like to make this field in a check - box set where all employees can be chosen and be reflected in this report.

       

      Please assist with the script that would be necessary for this to take place.

       

      Thanks

       

      Bertlyn

        • 1. Re: Choose All Values in a check-box set for Report
          erolst

          Do you really mean "all" employees?

           

          If so, then you either show all records in the Employees table, or don''t use Employee as a search criterion in other tables.

           

          If, OTOH, you mean "employees selected in the checkbox", try

           

          If [ IsEmpty ( YourTable::yourCheckBoxField ) ]

            Exit Script

          End If

          Set Field [ $employeeList ; YourTable::yourCheckBoxField ]

          Go to Layout [ YourSearchLayout ( SearchLayoutTableOccurrence ) ]

          Enter Find Mode

          Loop

            Set Field [ YourSearchField ; GetValue ( $employeeList ; Get ( RequestCount ) ) ]

            Exit Loop if [ Get ( RequestCount ) = ValueCount ( $employeeList ) ]

            New Record/Request

          End Loop

          Set Error Capture [ on ]

          Perform Find

           

          or create a relationship where

          YourTable::checkBoxField = Contacts_bySelected::name

          and use Go to Related Record[]

           

          Note that rather than a name, you should use IDs as primary/foreign keys to identify (related) records unambiguously.

          • 2. Re: Choose All Values in a check-box set for Report
            DanielShanahan

            I concur with erolst: use the employee id.  Moreover, it sounds like you may need a join table:

             

            Activity ---<EmpAct>---Employee and have a date field (and time field, if needed) in the join table, so EmpAct::activityDate

            • 3. Re: Choose All Values in a check-box set for Report
              raybaudi

              Set Field [ $employeeList ; YourTable::yourCheckBoxField ]

               

              Set Variable [ $employeeList ; Value: YourTable::yourCheckBoxField ]