TimesheetEventReceiver OnUpdated

W

winnes

For as far as I understand correctly, this can be triggered from either:

- My Work|My Timesheets|Save (or Save & Submit)
- Approvals|Timesheet ... Save

How can we distinct the triggering source (I want to do different processing
in either case)
contextinfo or event arguments do not provide me this information at first
sight.

Thanks in advance
 
W

winnes

Correct me if I am wrong, but can the condition be : if (submitted) ...
(TimesheetHeaderRow.TS_STATUS_ENUM)?
 
I

Inquisit1

It sounds like you are on the right track...

The way I have handled this is to query the "Published" database (which
evidently is not supported by MS) for the TS_STATUS_ENUM value and use it in
a conditional statement as you have said.

dbo.MSP_TIMESHEETS.TS_STATUS_ENUM holds the value you need.

0 = In Progress
1 = Submitted
2 = Acceptable
3 = Approved
4 = Rejected

Code:

if (TS_STATUS_ENUM < 2)
{
// Timesheet was saved through "My work | My Timesheets"
}
else
{
// Timesheet was reviewed and was "Approved", "Rejected" or "Acceptable"
(Approved with next approver)
}

There is also a specific event handler for each case if you'd prefer to do
it that way.

Timesheet -> Submitted (fires when resource submits timesheet)

Timesheet -> Reviewed (fires when timesheet is approved or rejected)


Hope this helps!
 
Top