Using getMinOfField on checkmarks…

Viewing 2 reply threads
  • Author
    Posts
  • December 10, 2022 at 3:18 PM #48469

    richard maliszewski
    Participant

    In a summary view of budget envelopes, I’d like to flag the envelopes that have outstanding unmatched transactions. All the envelopes have a “Matched” field that is a checkmark. Since these are stored as 1/0, I had expected an “envelope.getMinOfField(matchedFieldId)” to return 0 if there are any unchecked records in that envelope, and 1 if there aren’t. I seem to be getting “1” even when there are checkmarks in that field that are empty. Puzzled.

    –Richard

    December 10, 2022 at 6:33 PM #48472

    Brendan
    Keymaster

    Try checking for the count instead of the min. Then you’ll get either 0 or whatever the count is of the number of 1s.

    December 10, 2022 at 7:03 PM #48473

    richard maliszewski
    Participant

    Perhaps I wasn’t clear enough. I want to know if there are any *unchecked* records. I’ve gotten past this by doing a getRecords() on the form, getting the length of the resulting array, and then comparing that to the total for the field. If the total is less than the number of records, then there’s at least one unchecked record. This seems a little heavy-handed, but works.

    –Richard

Viewing 2 reply threads

You must be logged in to reply to this topic.