none
Accessing working-hours for a resource per task over a certain timespan (week or day) for a checked out project. RRS feed

  • Question

  • Hello,

    First off, i am working with ProjectServer and Microsoft.Project.Server.Client library for 5 days now and my c#-programming or lets say my overall programming-skills kind of rusty...

    At this point it feels like i am banging my head against a wall :/

    I got it, that i have tasks and resources, which are connected over the assignments, when i assign different resources to different tasks.

    But i can't quite figure out, how i can get to the workinghours on a day/week for a resource on and assigned task (or task on a assigned resource).

    The main issue i see, is that all the class-members hold overall values in working hours. But these values are not time consistent over a week/month and so on. So i can't calculate them over a certain time-span.

    The values have to be somewhere, since we entered them in the form, but i can't figure it out.

    Maybe someone on here as an idea or figured it out already. I'd appreciate every kind of help/tip.

    Greetings, Chris

    PS: i am working with the Draft-Taks/ProjectResource/Assignemt-classes and their coherent collection-classes.



    • Edited by CK_tgw Monday, July 15, 2019 11:15 AM
    Monday, July 15, 2019 11:11 AM

Answers

  • Solved with timephase  = DraftAssignment.Resource.EnterpriseResource.Assignments.GetTimephase(DateTime start, DateTime finish)

    StatusAssignmentCollection = timephase.Assignements 

    then iterate through that collection with knowledge wich resource and which Task you are searching for. The information required is the StatusAssignment.Work field in the end.

    • Marked as answer by CK_tgw Wednesday, July 31, 2019 7:22 AM
    Wednesday, July 31, 2019 7:21 AM

All replies

  • Chris,

    I'm not sure how this translates to C#, but in Visual Basic the information you want is available via

    Task.TimeScaleData, Resource.TimeScaleData or Assignment.TimeScaleData Methods.

    I suggest you consider a VBA approach, as I understand it, in Project VBA runs faster and more efficiently than other programming methods.

    Hope this helps.

    John

    Tuesday, July 16, 2019 3:08 PM
  • Thank you very much i will look into it! 

    Greetings, Chris

    e: thank you for the suggestion, but in c# these classes don't exist. Also there is no instance like TimeScaleUnit, that would make it possible to calculate the values.


    • Edited by CK_tgw Wednesday, July 17, 2019 8:09 AM
    Wednesday, July 17, 2019 7:00 AM
  • Solved with timephase  = DraftAssignment.Resource.EnterpriseResource.Assignments.GetTimephase(DateTime start, DateTime finish)

    StatusAssignmentCollection = timephase.Assignements 

    then iterate through that collection with knowledge wich resource and which Task you are searching for. The information required is the StatusAssignment.Work field in the end.

    • Marked as answer by CK_tgw Wednesday, July 31, 2019 7:22 AM
    Wednesday, July 31, 2019 7:21 AM