Forum Discussion

DavidHalter2's avatar
DavidHalter2
Qrew Member
4 years ago

Button to clear 'primary address' some other record and allows adding to the current child record

Hi.  Another question. I seem to be missing something about how buttons seem to work.  For this post, I referred to Setting a 'Primary' address- How to ensure only 1 child record has a checkbox checked | Discussions (quickbase.com). I needed that functionality, but I've got another question to follow up that one.

I'm wondering, however, if a user is in the midst of adding a New address, what can the user do to clear that primary address checkbox from other records in order to allow adding the new address as a primary?  Is there a button/url design that will function this way during the Add process?

I tried adding a ToggleCheckbox button (thanks Kirk Trachy) which triggers an automation to do the search and clear, but it only seems to fire correctly when editing the record, not when entering a new record.  And I suppose another option is to use a button to make the changes in the parent form after the new record is entered with the similar buttons and maybe an automation (thanks again Kirk Trachy) but I want to be able to allow the user to change it when they think of it as they are entering the new record. Is that possible?

Thanks
Dave


------------------------------
Dave Halter
------------------------------
  • Are probably many ways to do this but one way would be to trigger an automation when an address is added or edited and the primary checkboxes checked.

    I would set up a checkbox field which would be true of the [Date Modified] was not within the last minute.

    The field might be called [Previous Primaries OK to clear?]

    IF(Now() - [Date Modified] > Minutes (1) and [Primary]  = true)

    The automation would modify other records which were primary but had not been just modified.

    Make sure that the Automation filter just applies were the Related Parent is the same as the record being modified.

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------