1 Reply Latest reply on Mar 13, 2014 12:45 PM by philmodjunk

    Yet another problem with alert flags

    CraigAlderson

      Title

      Yet another problem with alert flags

      Post

           Sigh. I don't know why these alert flags are so troublesome.

           I have a table with an address field. There's a separate field with an "action needed" that has several values: no action, add, delete, update. For anything other than "no action," we need to update records elsewhere in our office. I just want a flag on my main data layout that displays whenever any record in the database is other than "no action." Should be simple, right?

           I set up a global calculation field to be false when the action field was "no action" and true when it was any other value. I put an alert flag on the layout with conditional formatting so it displays when the global field is true and doesn't when the global field is false.

           The problem is how this interacts with the new record and delete record functions. If I create a new record the action field is set to "add," but if I then abort the record creation by doing revert record, the global field doesn't reset. It still shows as true, even if every other record in the database is "no action," thus causing the alert flag to display.

           There's a similar problem with deleting records. If only one record in the database has an action-needed value, the flag displays. If I delete that one record, so there's no other record with an action-needed value, the global field doesn't reset. It remains true and the flag continues to display.

           All I want is the flag to display when action is needed for any record in the database (not just those in the found set) and disappear when it's not. Thanks.

        • 1. Re: Yet another problem with alert flags
          philmodjunk

               Global calculation fields are not the best option for this. The "rules" for how they update are pretty funky--the most recently modified record's values are what updates it.

               I'd put an OnObjectModify trigger on the action needed field that set's a field in a utility table to True if any value but No Action was selected in that field. If "No Action" was selected, I'd use an ExecuteSQL calculation to see if any other record in the table does not have a "no action" entry and then updates this same field accordingly.