Forum Discussion

MikeBrady's avatar
MikeBrady
Qrew Trainee
2 years ago

Allow single record to have checkbox set

Hello, I would like to set an "active" status on a record using a checkbox field.  I only want a single record in the table to be active.  Does anyone know how to do this? I'd like to create a new record, set the checkbox, and have any previous record be unset.  Or at least throw a warning when the checkbox is set that there is another "active" record already.

------------------------------
Mike Brady
------------------------------

4 Replies

  • Is the "record" across the entire table; or only 1 child of a parent should be active?

    ------------------------------
    Laura Thacker (IDS)
    laura@intelligentdbs.com
    (626) 771 0454
    ------------------------------
    • MikeBrady's avatar
      MikeBrady
      Qrew Trainee
      Hi Laura, I want to do this across a single table.  I am adding records for our current manpower count, but want to keep the old records.  So I was hoping to add a record, and set it as "Active", and automatically unset the previous "Active" record in the same table.

      ------------------------------
      Mike Brady
      ------------------------------
      • LauraThacker's avatar
        LauraThacker
        Qrew Captain
        I would probably set it up this way, on the assumption that the most recent entry is the active record.

        1. Build an ADMIN table (hidden from users).
        2.Create a single-record in your ADMIN table
        3. Create a relationship between your ADMIN < RECORDS (don't know what yours are called) table
        4. Build a summary field to pull the Maximum [Record ID#] of the RECORDS table to the ADMIN table (find out the highest Record ID#)
        5. Add LOOKUP of [Max Records Record ID#] back into the RECORDS table via the relationship
        6. Add a formula-checkbox field with the formula
        [Record ID#] = [Max RECORDS Record ID#]​
        7. Change the [Related Admin] reference field to a Formula-Numeric field, with a fixed-value of 1 (this means that every single RECORDS table record is automatically connected to your ADMIN table record and is "feeding" the record information back to the Admin table so that your RECORDS table can use the maximum record id# value to determine whether the latest one is the 'active' one.

        There are other ways to do this too; but this would be self-adjusting and require no extra work.

        ------------------------------
        Laura Thacker (IDS)
        laura@intelligentdbs.com
        (626) 771 0454
        ------------------------------