Hello!
We're currently facing the following scenario:
- Employee creates time entry in their timesheet for a specific task and saves their timesheet.
- Project manager marks the task as complete.
- Employee then submits their timesheet some time after. Since the entry already exists in the timesheet from before the PM marks the task complete, the time still gets submitted as normal.
This is causing issues for the PM as they now see extra hours on their tasks after they have marked the task complete.
To counter this, I am writing a beforeSubmit UE script that will stop any submits from happening if a task on that timesheet is closed on pressing the submit button. The checks seem to be working and the error code does appear.
The issue that I'm running into now is that it doesn't seem to be stopping the submit when the error appears. If I refresh the page, the time entries have been submitted and they appear as "Pending Approval"
I'm throwing an error to make this happen, but how can I make the page abort the submit? I would like that, as soon as the error is thrown, it stops from submitting time entries on the timesheet.
Thanks for all the help!