none
ApproveNonProjectTime method GeneralItemDoesNotExist error RRS feed

  • Question

  • Hello everybody,

    I try to approve non project time in a console application.

    My code is very simple :

    class Program
        {
            const string projectServerUri = "http://morpheus-sp/pwa/";
            const string resourceServicePath = "_vti_bin/psi/Timesheet.asmx";
            
            static void Main(string[] args)
            {
                TimesheetWebSvc.TimeSheet timesheetSvc = new TimesheetWebSvc.TimeSheet();
                timesheetSvc.Url = projectServerUri + resourceServicePath;
                timesheetSvc.Credentials = CredentialCache.DefaultCredentials;
    
                timesheetSvc.ApproveNonProjectTime(new Guid[] { new Guid("D6909043-18A7-4FF6-83BB-67EFDF17A279")}, null);        
            }
        }

    When I execute it I have this error message :

    System.Web.Services.Protocols.SoapException: ProjectServerError(s) LastError=GeneralItemDoesNotExis

    However I took the TS_LINE_UID directly in my DB and its status is Pending Approval.

    Have you a solution ?

    Thank you,
    Justin


    Wednesday, November 14, 2012 3:25 PM

All replies

  • I try this :

    static void Main(string[] args) { TimesheetWebSvc.TimeSheet timesheetSvc = new TimesheetWebSvc.TimeSheet(); timesheetSvc.Url = projectServerUri + resourceServicePath; timesheetSvc.Credentials = CredentialCache.DefaultCredentials; TimesheetWebSvc.TimesheetDataSet timesheetDs; timesheetDs = timesheetSvc.ReadTimesheet(new Guid("694BC9C3-1B00-44F2-BCCE-8F4D3DBD0B98")); TimesheetWebSvc.TimesheetDataSet.LinesRow[] approvalNeeded = (TimesheetWebSvc.TimesheetDataSet.LinesRow[])timesheetDs.Lines.Select("TS_LINE_CLASS_NEED_APPROVAL = true"); timesheetSvc.ApproveNonProjectTime(new Guid[] { approvalNeeded[0].TS_LINE_UID }, null); }

    approvalNeeded[0].TS_LINE_UID has a value but the error is the same...

    Friday, November 16, 2012 10:34 AM