Hi everyone, I have an app which records fa...

references
(Leah Hoogstra) #1

Hi everyone,

I have an app which records family information in a Family table and uses reference fields to relate to a People table tracking which people are in which families. I want the user to be able to move a person from one family to another, but I’d like to throw up a warning/confirmation message if they edit the field which does this (the FamilyID field on the Person record).

The entry field would still be valid, so I can’t use the Error_Message_If_Invalid function. I want to at least throw up a warning message if they edit this field, and preferably have the user confirm that they intend to make this change before saving. Is there a way to do this?

(Praveen Seshadri (AppSheet)) #2

Instead of a popup message, consider having a Show column that is normally hidden. But it gets shown if the FamilyID field gets edited. How do you do this?

The easiest way is to have another hidden column that is a ChangeCounter (this is one of the column types). it can be set up to track changes on one specific column — in this case on FamilyID. The Show column with the warning message to be shown will then have a Show_If constraint of the form [ChangeCounterColumn] > 0

(Leah Hoogstra) #3

Thank you! This works really well. I actually already had a ChangeTimestamp column called [FamilyIDModified] which logged the timestamp if someone modified the FamilyID. As is, this solution shows the warning field every time they edit the record after changing the ID once. That would be useful for some purposes, but I wanted the warning message only to show up right when someone made the ID change, so I tweaked it a bit. I set the Show_If condition to be if DATE([FamilyIDModified])=TODAY(), which gets pretty close to that. I could get more specific about when to show the message by using the datetime, but this works for now.

Thanks again!

(Praveen Seshadri (AppSheet)) #4

Hi Leah, the ChangeCounter type has an option of Accumulate or Reset. If you choose Reset, it gets reset to 0 every time the row is edited. Which makes it very useful for this specific scenario. All you have to do is check if the ChangeCounter is greater than 0.

(Leah Hoogstra) #5

@praveen Thanks! I didn’t notice that detail. This works perfectly!

(Syed Faheemuddin) #6

Just following!