Task Update Errors

Jun 16, 2009 at 2:51 PM
 
Hi all, when I successfully configured EPMTSST, I got this problem when a resource was posting a timesheet:
 Standard Information:PSI Entry Point: Statusing.ImportTimesheet
Project User: CSIL2003\svc-sharepoint
Correlation Id: 83dd7697-19dd-4f60-8bdd-6ca508dbef3c
PWA Site URL: http://csil-sp-project/PWA
SSP Name: SharedServices1
PSError: TimesheetIncorrectPeriod (3208)
Timesheet period used '(null)' is invalid.
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
 
I made a few changes to the code, as shown below:
#region STEP 3 - Perform statusing impersonation taking surrogate into account

                // Need to retrieve resource information to do proper impersonation
                ResourceWS.ResourceDataSet resourceDS = resource.ReadResource(tresUID);
                ResourcePSI resourcePSI = new ResourcePSI(resourceDS);

                // Check if surrogate timesheet
                if ((tsHeader.CreatorResUID != tsHeader.ResUID) // owner is different than creator
                    ||
                    (!resourcePSI.WindowsAccount.Equals(contextInfo.UserName))) // case where timesheet was modified by timesheet manager
                { 
                    //NEW FIX HERE
                    //@@@@@
                    Guid svcSharePointGUID = new Guid("{385e99d6-f809-441b-a991-7fea90ad7045}");
                   //original: statusing.SetImpersonationContext(resourcePSI.IsWindowsUser, resourcePSI.WindowsAccount, tresUID, Guid.Empty, contextInfo.SiteGuid, contextInfo.Lcid);
                    //edit: statusing.SetImpersonationContext( resourcePSI.IsWindowsUser, "csil2003\\svc-sharepoint", svcSharePointGUID, Guid.Empty, contextInfo.SiteGuid, contextInfo.Lcid);

                    bool isWindowsUser = contextInfo.UserName.StartsWith("AspNetSqlMembershipProvider") ? false : true;
                    statusing.SetImpersonationContext(isWindowsUser, contextInfo.UserName, tresUID, Guid.Empty, contextInfo.SiteGuid, contextInfo.Lcid);
                }
                else
                {
                    // Faster check that calling the resource web service
                    bool isWindowsUser = contextInfo.UserName.StartsWith("AspNetSqlMembershipProvider") ? false : true;
                    
                    
                    
                    statusing.SetImpersonationContext(isWindowsUser, contextInfo.UserName, tresUID, Guid.Empty, contextInfo.SiteGuid, contextInfo.Lcid);
                }

                if (logEvents)
                    appLog.WriteLine(string.Format("STEP 3 - Statusing Impersonation for RES_UID: {0}", tresUID.ToString()));

                #endregion

This seemed to avoid the aforementioned error message, however no updates were found in the resource's "My Tasks" once the timesheets were approved. 
Could anyone provide any assistance?