How to cancel automatic approval of timesheet from event handler? Hi,
I am doing some custom validation in the timesheet OnSubmitting event handler and cancelling the submission (e.Cancel=True) if its not valid.
Usually, when the resource and timesheet manager are the same person, the timesheet gets approved automatically on submission, with the message "System generated automatic approval"
Now, the problem that I am facing is, When the Resource and Resource's Timesheet Manager is the same, when timesheet submission is cancelled from the OnSubmitting eventhandler, the status of timesheet becomes, "Error" and in the queue, there occurs the following job. Job Type:Timesheet Review Job State :Failed And Blocking Correlation
I believe it is because the system is trying to auto approve the timesheet.
Any idea how we can cancel the auto approval of timesheet from the "OnSubmitting" eventhandler of timesheet. I want to cancel the auto approval only if the timesheet is not valid according to the custom validator.
Any thought on solving this will be helpful.
Thanks,
Sindia
|