The latter, or in relation to quotes. The badges is interesting as I previously understood them to be case-sensitive. I suspect they are but if no match Tinderbox probably silently tries a case-insensitive match.
I didn’t have a chance to build a test for your code last night so my post was just testing for a code syntax error.
I think the functional error is your ‘if’ test. I suspect you want to only set the current time if $EndDate_ is not already set_. If so, your test should be:
if($Checked==true & $EndDate!="never")...
That way, checked notes with an EndDate aren’t reset.
In addition to @mwra’s always-authoritative advice, there’s another trick, just in case you (@andreas) are not aware of it or have forgotten about it. It’s the |= operator, the “pipe” symbol followed by the equal sign.
If the action part of your agent says the following:
Then the value for $EndDate will be updated only if it hasn’t already been assigned a value. Otherwise the value remains what is already there. It’s a different way of testing for an empty / default-value / unassigned field (recognizing slight differences among these).
The way I think of the |= operator, which I use all the time, is that it assigns a value where there isn’t one, but it doesn’t mess up any value you have intentionally assigned. aTbRef has the more detailed explanation here.