I have a boolean variable (varUpdated) in a custom SharePoint list form. I set it to false in the OnStart property of App. I then set it to true in the "OnChange" property of editable fields. So when any of these fields change, varUpdated should change to true.
I have a similar set of variables for three other fields to indicate that they have had their values changed (varRequestorComments Changed, varProgrammerCommentsChanged and varAdminComments Changed). All are set to false in OnStart. They are individually set to true in the OnChange property of the appropriate comments field.
I have a corresponding Yes/No field for each of these variables in the SharePoint list. I set the Default and Update properties for each of these Yes/No fields to the corresponding variable. The three comment variables all work exactly as expected. When new comments are added in a comment field, the variable is set to true and updates the Yes/No field properly. The next time the form is edited, the variable is again set to false and this updates the Yes/No field to false if no comments are added to that section.
The purpose behind these variables is to have HTML generated (or not) for an email notification when a record has changes made. The comment fields are working as expected and only display in the email when new comments have been added.
The varUpdated variable however is ALWAYS true whenever the form is put into edit mode. In view mode, it remains false as expected. I have tried adding Set(varUpdated, false) in the OnView and OnEdit properties of SharePointIntegration both before and after the EditForm and ViewForm functions. No change either way. Once the form is in Edit mode, varUpdated ALWAYS switches to true. It does NOT switch to true in New mode.
The fields that need varUpdated to be true when they are changed are of varying data types. There are date fields, text fields and combo boxes. All I can think of is that one of these field types has its OnChange triggered when the form goes into edit mode. Since the comment fields (MLoT data type) are working correctly, it may be the date or combo boxes that are causing the issue. But the fact that it works properly in New mode confuses me even more.
If anyone has experienced this in the past and knows how to resolve it, please let me know!