Hello,
I am needing some input/assistance with a problem/glitch I am coming across in the build of a time tracking/project management app for my company.
Context/Background:
Within the timetracking app I have a screen dedicated to new timesheet creation. On this screen I have a component which has the purpose of displaying various notifications and error messages that a user may experience when attempting to complete the timesheet. The component is fed message data from a dataverse table, in which I have outlined the various types of messages, their message body (the error/explanation/notification). When I user does something that would trigger the popup box to appear with a notification or error I pass a variable (primary key/title) for which message should be displayed.
So, for example, if a user attempts to [create timesheet] without first entering a name or date, the button checks for missing values, updates the message variable via the Set function to the message type, and then sets the component's visibility property to true, so that it will appear. The message says "you must have a name and date to create a timesheet!", and has an [OKAY] button below for them to acknowledge and close the message box.
There are other types of errors or situations which may arise however that an [OKAY] message is not sufficient for. In these cases I have the message type within the dataverse table set to YesNo rather than Okay. This causes the message box to display the options (buttons) [YES] and [NO] and hide the button [OKAY] from view. In these cases, typically, the option [NO] will simply close the message box, while [YES] will update a variable to or perform an additional function necessary to complete the timesheet.
The Problem:
The problem is that when only OKAY message types are being triggered it is working perfectly, even with different types of [OKAY] messages. However, when multiple message types need to appear in one session the buttons (and only the buttons) visibility attribute seems to glitch out, so that none of them ([OKAY], [YES], [NO]) do not appear. I believe that this is a glitch because when I exit play mode, and then switch over to the component window they appear, and the moment I go back to screens they appear. I can then press play and resume the session. The same thing happens in reverse. For instance, if a [YES]/[NO] prompt occurs first then an [OKAY] prompt follows it the [OKAY] button will not appear. When I switch over to components and back to screens it is there.
It is like the change in the visibility attribute is note working correctly or something. However, it is also odd, because the initial button (the one first encountered) DOES disappear properly. So if you go from OKAY to YES NO the OKAY is correctly not shown, it's just that YES NO is missing. The same is true in reverse. Also, maybe important to note, that this issue is ONLY impacting the buttons functionality. The text within the error message always seems to change correctly. So even when the button is missing the associated text of that message type is correctly displaying.
Below is a GIF I captured of the issue occurring. In this example I had intentionally triggered a OKAY prompt to appear prior to the recording, and then you can see the result of the YES/NO prompt appearing but the buttons being missing, as well as them becoming visible when I exit play mode and make the switch to components. The poor quality is somewhat intentional, as you can see the issue but the information on the screen is somewhat distorted.
*The post fails to submit when I attempt to include the GIF, submitting without the GIF and then I will try to edit and upload it*
Other important troubleshooting notes:
- I have tested using a timer delay to prevent messages from loading for 2 seconds time, thinking that maybe the script was being ran so quickly that the component hadn't had a chance to catch up and correctly display the buttons needed. This did not work and the same issue persisted.
- I have tested connecting the buttons to a collection of the data, rather than to the database. This did not work and the buttons continued to not appear correctly.
Scripting in Use:
Here are some snippets of scripts relevant to the issue, in case they are important in troubleshooting
Button Visibility Formula in the component
If("YesNo" in LookUp(colMessages,varMessage=crb01_messageid,crb01_messageoptions),true,false)
Portion of IF statement in the timesheet sheet which checks for total hours less than 40, and if hours are less than 40 if triggers the message type and sets the popup box visibility to true
Value(lblNewTSRowItems_Sum_TOTAL.Text) < 40 && varNewTSSubmissionConfirmation = false,
Set(
varMessage,
"NewTSWarningSubmitDataUnder40"
);
Set(
varMessageVisible,
true
);