Forum Discussion

Hans Christian's avatar
Hans Christian
Copper Contributor
Jun 13, 2018

CSOM Project Online timesheet for resource per day

Does anyone ever develop time-sheet's actual work of a resource pro-grammatically using CSOM? I'm currently trying to fix the issue that I had with the code that I wrote. It is basically very similar to this post right here: https://sharepoint.stackexchange.com/questions/184944/add-resource-assignment-work-by-day 

 

I'm having issue when entering an actual work on the next day of the time-phase. I was able to entered in the time at the first insertion to actual work. For instance,

 

I expect: 

                                            06/12/2018            06/13/2018

Resource A Actual Work             5h                          3h

 

What I got:

                                            06/12/2018            06/13/2018

Resource A Actual Work             8h                         

 

The 3h supposed to be on 06/13/2018 was somehow added to the 06/12/2018. I have set the timephase to set and write it to 06/13/2018. In fact, when I debug my code line by line to see what date it was reading, it is actually reading from the correct date 06/13/2018 and has a 0 hr, then I set that timephase to 3hr, and reprint the actual work after setting it, and looks correct 3hr. But on the Timesheet UI, it is showing as the above result. (it seems it puts 3hr to the 5hr on 06/12/2018), which is strange. 

 

Any helps/explanation is appreciated. Thanks - HC

  • Ian Bruckner's avatar
    Ian Bruckner
    Iron Contributor

    Do you allow future-dated time entry?

     

    PWA Settings > Timesheet Settings and Defaults > Allow future time reporting

    • Hans Christian's avatar
      Hans Christian
      Copper Contributor

      Hey Ian, Thanks for your reply. That settings has already been allowed. I'm just not sure if the issue that I was experiencing is coming from a configuration side or the CSOM code itself. 

       

      I was able to entered in time for the initial date, but when my application synchronize to put more actual hours on the next day, that doesn't work. However, I figured that if I delete the task from the schedule and re-synchronize the task back to the timesheet, that will work and set me the actual hour to multiple days.

       

      Any other suggestions, I also have created a ticket to microsoft regarding this issue.

      • Ian Bruckner's avatar
        Ian Bruckner
        Iron Contributor

        That was my "easy" guess. To understand better, though, would you care to share your code?

Resources