Announcements
Hello - when a user changes a field or dropdown, I set a varDataChange = true which then makes a SubmitForm button visible (and then we use submitform(frmName) to update the data in sql server. The problem is that the var is not set until the user clicks out of the field. So if they change a data item, don't click out, they can easily leave the form by accident with no real change to the data. Suggestions please on a better approach? Thanks!
@CedarTree72
Initialize this variable like UpdateContext({varDataChange: false}) in the OnVisible property of the screen so that when the user gets to the screen, it will be false, and when the user uses control or text input, it will change to true.
If the user is moving between records using a vertical gallery on the left, and editing each record on a "subform" on the right, does that change your suggestion? When does the OnVisible event actually trigger if someone never "changes screens"? Thanks.
OnVisible will run the variable when the user enters the screen that's when the user switches from screen to screen or the app is starting on that screen . You can also set variable from App.OnStart by adding there code Set(varDataChange, false) and every time the app starts that variable will be set to false. Everything depends on the scenario and how you navigate the user to that form.
Okay, so when I update a date picker field or a dropdown, the app deems the data has changed and behaves correctly. But for a free entry field, it waits until you've moved to another field to assess if the data has changed. How can I address this please? THANKS.
Personally, I would add code to the Visible property of the button:
If(IsBlank(DataCardValue1.Value) && IsBlank(DataCardValue2.Value) && IsBlank(DataCardValue3.Value), false,true)
Or use DisplayMode property:
If(IsBlank(DataCardValue1.Value) && IsBlank(DataCardValue2.Value) && IsBlank(DataCardValue3.Value), DisplayMode.Disabled,DisplayMode.Edit)
Have you considered setting your Submit button's visible property to frmName.Unsaved?
Unsaved is a boolean that determines if a form's current field contents is different than the field's default value. So even if they don't click out of the field, it would still come up as true if the value has changed.
Thanks @zuurg / @SebS. The unsaved property works but it seems to me that it must use cookies? Because it starts out with all records unsaved, and then as I save them, it turns off the submit button. Will that hold true for another user who comes to the same record? Will it default to being saved or unsaved? Or can I from an outside control (eg, gallery) set seach record to be Saved when you first land on the record?
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 382 Super User 2026 Season 2
Mohsin Ali 329
WarrenBelz 187 Most Valuable Professional