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
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.
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