Project server programming - Error for self approving timesheet

S

sindia

Could you please help to resolve the following issue?

I have a scenario where I need to validate timesheet before submission. For
this, I have written custom code in the timesheet "OnSubmitting" eventhandler.
If the timesheet is not valid, I cancel the timesheet submission( e.Cancel =
true)

public override void OnSubmitting(PSContextInfo contextInfo,
TimesheetPreSubmitEventArgs e)
{
base.OnSubmitting(contextInfo, e);
e.Cancel = timesheetValidator.ValidateTimeSheet(e.TsUID);//
custom validation
}
This is working as expected in the case of Resource and Resource's timsheet
manager being "different" persons.
However I am facing some issues in the case of Resource and his timesheet
manager being the "same person"

When Resource and his timesheet manager are the "same person"
If the timesheet is valid,
On "Save and Submit" of the timesheet, the timesheet gets submitted and
gets approved automatically.
Timesheet's Status changes to "Approved" and Transaction comment = "System
generated automatic approval"

If the timesheet is not valid,
On "Save and Submit" of the timesheet, the timesheet submission is
cancelled by the eventhandler
(e.Cancel=true) and Timesheet's status changes to "Error".

On opening the timesheet again, the following error message is shown at the
bottom of page
While communicating with the Project Server an error occured. Check
connectivity with your administrator to determine if further action is
necessary. In "Manage queue" , there occurs the following job.
Job Type:Timesheet Review
Job State :Failed And Blocking Correlation

I presume that the system is trying to auto approve the cancelled timesheet.
Could you please help us to solve this problem of automatic timesheet
approval?

Thanks,
Sindia
 
D

Dale Howard [MVP]

sindia --

I would recommend you repost this question in the
microsoft.public.project.developer newsgroup, as you are more likely to get
a reply in that newsgroup. Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top